Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning DATEDIFF Value As hh:mm:ss
Message
 
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00635803
Message ID:
00635808
Views:
14
>DATEDIFF(hh,dtStart,dtEnd) returns a value in whole integer hours only.
>
>How do I return the value expressed as hh:mm:ss ?
>
>Thanks for your help.
>

Try
CONVERT(char(8), DATEADD(second, DATEDIFF(second, dtStart, dtEnd), '20020101'), 8)
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform