I found a couple examples online but I don’t quite understand how it works. e.g
SELECT DATEADD(ww, DATEDIFF(ww,0,GETDATE()), 0)
I’m not even sure it does what I want.
What I need is, when the query is executed, it can SELECT * from xTable WHERE xDate is between two dates. Last sunday and next sunday (current week). What could I use to find it automaticly? And please explain because I’m new to SQL.
I looked deeper in trying to understand this query
And used it to retreive the previous monday. Now I can simply
DATEADD6 more days to get a full week.The solution I used :
Problem solved.