Created
September 17, 2013 09:26
-
-
Save bitsprint/6592067 to your computer and use it in GitHub Desktop.
Round date to midnight
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
| -- SQL 2008 | |
| DECLARE @CurrentDate DATETIME = (cast(GETDATE() as date)) | |
| -- Pre SQL 2008 | |
| DECLARE @CurrentDate DATETIME = DateAdd(Day, Datediff(Day, 0, GetDate()), 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment