Skip to content

Instantly share code, notes, and snippets.

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 davidsheardown/4c4e8a6ba1013ae4c58bbddb1f99b8de to your computer and use it in GitHub Desktop.
Save davidsheardown/4c4e8a6ba1013ae4c58bbddb1f99b8de to your computer and use it in GitHub Desktop.
/*
Get date as Monday of current week.. just change the "0" in the last param to whichever day you need
i.e. SELECT DATEADD(wk, DATEDIFF(wk,0,GETDATE()), 2) would return date as Wednesday of current week
Handy to do date between or greater than checks
*/
SELECT DATEADD(wk, DATEDIFF(wk,0,GETDATE()), 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment