Skip to content

Instantly share code, notes, and snippets.

@farindra
Created April 22, 2015 02:26
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 farindra/835caea31bf4cd3348e0 to your computer and use it in GitHub Desktop.
Save farindra/835caea31bf4cd3348e0 to your computer and use it in GitHub Desktop.
get monday date of the week SQL Server
DECLARE @mydate DATETIME,@devval VARCHAR(50)
set @devval='2015-04-01'
SELECT @mydate = GETDATE()
-- Monday of Current Week
SELECT DATEADD(WEEK, DATEDIFF(WEEK, 0, @devval), 0),
'Monday of Current Week'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment