Groups | Blog | Home
all groups > sql server programming > march 2004 >

sql server programming : Time Intervals


MikeM
3/6/2004 3:16:06 PM
I've capture total number of seconds from a start date and end date. I want to be able to display the time interval in
day(s) hours:minutes:seconds

Any assistance would be great

thanks
mikem
3/6/2004 4:16:05 PM
thanks Aaron Bertran
I used the seconds and converted each one into mins,hours,days and used this formul
eg. 8536 sec
turns into A) 142 minutes (rounded
turns into B) 2 hours (rounded
turns into c) 0 day

Days =
Hours = B - (C * 24)
Minutes = A - (B * 60
Seconds = secs - (A * 60

And concatenated "Day(s) Hours:Minutes:Seconds
Aaron Bertrand [MVP]
3/6/2004 6:28:50 PM
Here's a start...
http://www.aspfaq.com/2271

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


[quoted text, click to view]

AddThis Social Bookmark Button