I need the correct syntax to give me :
GETDATE()
It should be noted that the issue with Sundays appears to no longer be present at least as of MSSQL 2012. Both the simple solution
SELECT DATEADD(wk, DATEDIFF(wk, 6, @input), 0)
and the complex one
SELECT DATEADD(wk, DATEDIFF(wk, 6,
CASE DATEPART(dw,@input)
WHEN 1 THEN DATEADD(d,-1,@input)
ELSE @input
END
), 0)
return the same for any date that I've tried, including Sundays.