Skip to content

Instantly share code, notes, and snippets.

@sshaffer
Created September 28, 2017 13:30
Show Gist options
  • Save sshaffer/5477e98c4d11863b3508ca37ef8f2c72 to your computer and use it in GitHub Desktop.
Save sshaffer/5477e98c4d11863b3508ca37ef8f2c72 to your computer and use it in GitHub Desktop.
--YEAR First of Month YYYY-MM-01 Format
DATEADD(MONTH, DATEDIFF(MONTH, 0, [date_column]), 0) AS YearMonth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment