How to get elapsed time in Seconds, Minutes, Hours from start of current day?
SELECT DATEDIFF(SECOND, 0, Cast(GETDATE() AS TIME)) -- In Seconds SELECT DATEDIFF(MINUTE, 0, Cast(GETDATE() AS TIME)) -- In Minutes SELECT DATEDIFF(HOUR, 0, Cast(GETDATE() AS TIME)) -- In Hours
No comments:
Post a Comment