Skip to content

Instantly share code, notes, and snippets.

@clintmjohnson
Created May 21, 2015 22:32
Show Gist options
  • Select an option

  • Save clintmjohnson/a0ab56cbee8e2fd35d9e to your computer and use it in GitHub Desktop.

Select an option

Save clintmjohnson/a0ab56cbee8e2fd35d9e to your computer and use it in GitHub Desktop.
Determines the Last Day of a Month EOMONTH SQL SERVER
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