Skip to content

Instantly share code, notes, and snippets.

@radleta
Created December 24, 2013 13:23
Show Gist options
  • Save radleta/8113311 to your computer and use it in GitHub Desktop.
Save radleta/8113311 to your computer and use it in GitHub Desktop.
Round DateTime to Nearest Minute. Useful when grouping by DateTime to round to the nearest minute.
SELECT DATEADD(MINUTE, 1+DATEDIFF(MINUTE, 0, GETDATE()), 0) NearestMinute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment