Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DD:HH:MM:SS:MS??

Status
Not open for further replies.

mbryantuk

Programmer
Aug 3, 2007
29
GB
Hi

I've managed to get a decminal value of seconds into HH:mm:ss:ms using

convert(char(12), dateadd(millisecond, (sum(totalduration)-cast(sum(totalduration) as int))*100, dateadd(second, cast(sum(totalduration) as int), 0)), 114)

but i have encounterd a issue where the value is too great and it goes over 1 day and it only returns the remander after the 1 day, how i can i work around this so it returns DD:HH:MM:SS:MS

Thanks
 
Sorry im being stupid i just want the hours to keep increasing and not to stop at 24,

thanks

Matt
 
Here is an FAQ's with a function that turns seconds into:

x Days HH:MM:SS

I am sure you can change the output format to your liking pretty easily. Enjoy, and post back if you run into any questions :)

faq183-6519

Hope this helps,

Alex

[small]----signature below----[/small]
I don't do any programming whatsoever

Ignorance of certain subjects is a great part of wisdom
 
Glad it worked :)

[small]----signature below----[/small]
I don't do any programming whatsoever

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top