Sunday, 3 March 2019

Get Start and end date of the next week in sql server

////////////////// Sql script

declare @SelectdData varchar(10)='2019-03-04'


SELECT DATEADD(d,(9- DATEPART(dw,@SelectdData)),@SelectdData) StartDateOfWeek, DATEADD(d,6,(DATEADD(d,(9- DATEPART(dw,@SelectdData)),@SelectdData)))EndDataOfWeek



///////////////////Result


No comments:

Post a Comment

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...