Created
May 21, 2015 22:32
-
-
Save clintmjohnson/a0ab56cbee8e2fd35d9e to your computer and use it in GitHub Desktop.
Determines the Last Day of a Month EOMONTH SQL SERVER
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 MyData, | |
| EOMONTH(MyData) AS LastDayOfThisMonth, | |
| EOMONTH(MyData, 1) AS LastDayOfNextMonth | |
| FROM (VALUES ('2012-02-14T00:00:00' ), | |
| ('2012-01-01T00:00:00'), | |
| ('2012-12-31T23:59:59.9999999')) dt(MyData) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment