Re: time conversions

Josh Hillman ( (no email) )
Thu, 6 Aug 1998 12:40:02 -0400

> From: William Salame <williams@kbd.com.au>
> select
> durationh = FLOOR(AcctSessionTime/3600),
> durationm = FLOOR(AcctSessionTime/60) - 60*FLOOR(AcctSessionTime/3600),
> durations = CONVERT(INT,AcctSessionTime) - 60*FLOOR(AcctSessionTime/60),
>
> Then we display <%durationh%> : <%durationm%> : <%durations%>

This type of stuff will work with CF/IDC scripts on the web, but I needed
it for plain ol' ISQL, which is why I was hoping there'd be a SQL
trick/function for it (but assumed that there wasn't). Thanks though...

Josh Hillman
hillman@talstar.com

> Josh Hillman wrote:
>
> > Is there a way to take an integer like 8625 (representing seconds) and
> > convert it into something like "2:23:45" using SQL? If at all
possible,
> > I'd like to use this in one of my scripts to show the integer
> > AcctSessionTime as hours:minutes:seconds (VarChar, I guess). If
> > AcctSessionTime were some form of Date/Time it would be easy using
> > CONVERT(whatever), but realistically, it makes sense that it's an
integer.
> >
> > Josh Hillman
> > hillman@talstar.com
>
>