I want to get the last day (Sunday) of the current week with any timestamp. I tried following the script, but it returns Saturday as the last day, not Sunday, as I expected.
Select DATEADD(DAY , 7-DATEPART(WEEKDAY,GETDATE()),GETDATE()) AS 'Last Day Of Week'
Any answer is welcome!
source share