Home Forums SQL Server 2008 SQL Server 2008 - General Query to find the start day of the week as Monday RE: Query to find the start day of the week as Monday
arnipetursson
SSCertifiable
Points: 6557
More actions
December 4, 2012 at 9:10 am
#1565386
set DATEFIRST 1
declare @dt datetime
select @dt = '12/09/2012'
select previousMonday = dateadd(dd,(-1)*(datepart(dw,@dt)-1),@dt)
set DATEFIRST 7