Skip to content

Instantly share code, notes, and snippets.

@garystorey
Created October 27, 2017 14:01
Show Gist options
  • Save garystorey/23fb3ed1310a54c428a770b6fb2e6c11 to your computer and use it in GitHub Desktop.
Save garystorey/23fb3ed1310a54c428a770b6fb2e6c11 to your computer and use it in GitHub Desktop.
DECLARE @current_date DATE = GETDATE()
SELECT EOMONTH (@current_date, 0) AS LastDayOfCurrentMonth
SELECT EOMONTH (@current_date, 1) AS LastDayOfNextMonth
SELECT EOMONTH (@current_date, -1) AS LastDayOfPrevMonth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment