I looked deeper, trying to understand this request
SELECT DATEADD(ww, DATEDIFF(ww,0,GETDATE()), 0)
And used it to restore the previous Monday. Now I can just DATEADD
another 6 days to get a full week.
The solution I used:
Set @Monday = DATEADD(ww, DATEDIFF(ww,0,GETDATE()), 0) Set @Sunday = DATEADD(dd, 06, @Monday)
The problem is resolved.
source share