Skip to content

Instantly share code, notes, and snippets.

@markmo
Created March 11, 2013 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markmo/5138203 to your computer and use it in GitHub Desktop.
Save markmo/5138203 to your computer and use it in GitHub Desktop.
Convert date to integer key
CONVERT(INT, (SELECT CONVERT(VARCHAR(8), SALE_TIMESTAMP, 112) AS [YYYYMMDD])) AS DateKey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment