sql_learner29
SSCrazy Eights
Points: 9107
More actions
June 2, 2009 at 7:16 am
#205583
Hi all,,
How can i use datediff to get diffrence between two dates in hour and minutes??
thanks
Thanks [/font]
Mark Cowne
One Orange Chip
Points: 26984
June 2, 2009 at 7:24 am
#1003402
See if this helps
DECLARE @d1 DATETIME
DECLARE @d2 DATETIME
SELECT @d1='20090602 10:23', @d2='20090602 14:24'
SELECT DATEDIFF(minute,@d1,@d2)/60 AS Hours,DATEDIFF(minute,@d1,@d2)%60 AS Minutes
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply