SQL, First and Last Days of Week

I needed to find the first and last days of the last week. Sunday being the first, Saturday being the last.

SELECT DATEADD(wk, DATEDIFF(wk, 6, '2013-08-11'), 6) AS START_OF_WEEK
SELECT DATEADD(wk, DATEDIFF(wk, 6, '2013-08-11'), 6 + 6) AS END_OF_WEEK

Source: http://stackoverflow.com/a/5925062

Leave a Reply

Your email address will not be published. Required fields are marked *