Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Date Difference.
Message
 
 
To
04/07/2005 23:50:29
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01028878
Message ID:
01029234
Views:
14
This message has been marked as the solution to the initial question of the thread.
>HI do u have any scripts that get the diffence of Datatime in hrs, Min, Seconds .

Assuming that the difference is less than 24 hours
DECLARE @dt1 datetime, @dt2 datetime
SET @dt1 = '2005/07/01 10:45:15'
SET @dt2 = '2005/07/01 17:23:37'
SELECT CONVERT(varchar(20), CAST(@dt2 - @dt1 AS datetime), 108)
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform