What is the best way to dynamically get the week date range, starting on Sunday and ending on Saturday?
So for example, today's date is 2018_08_29
I would like:
My first attempt would be using a cursor loop, loading in the date into a temp table, with this as a starting point:
SELECT DATEADD(DD, 1 - DATEPART(DW, GETDATE()), GETDATE())
However, I just want to know if there is even a better way of doing this, without a cursor loop?