Created
March 22, 2019 14:29
-
-
Save radleta/ad995b0f9f48d5a84904fbe7b432470b to your computer and use it in GitHub Desktop.
Round DateTime to nearest 5 minutes. Useful when grouping by DateTime to round to the nearest 5 minutes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT dateadd(minute, datediff(minute, '1900-01-01', dateadd(second, 150, GETDATE()))/5*5, 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment