If you want to get the first day and last day of the last week then you can use the following query.
This query will return first day of the previous Week
This query will return first day of the previous Week
SELECT CONVERT(DATE,DATEADD(WK, DATEDIFF(WK, 0, GETDATE()) - 1, 0)) First_Day_Of_Prev_Week
This query will return last day of the previous Week
SELECT CONVERT(DATE,DATEADD(WK, DATEDIFF(WK, 0, GETDATE()) - 1, 0) + 6) Last_Day_OF_Prev_Week
No comments:
Post a Comment
Please do not enter any spam link in the comment box.