⌘BABAKOV.NET Let's code!
100% [light] [ru]

Rounding Date to Hour and Minute in MSSQL TSQL

Example of rounding date to hour and minute

declare @dt datetime

set @dt = \'09-22-2007 15:07:38.850\'

select dateadd(mi, datediff(mi, 0, @dt), 0)
select dateadd(hour, datediff(hour, 0, @dt), 0)

Comments (0)

No comments yet.

Leave a comment
Comment
Images (up to 5 MB)
Your comment will appear after moderation.