xxxxxxxxxx
DateAdd(day, (-1* (DatePart(weekday, TIMESTAMP) % 7)) + 2, TIMESTAMP)
-- If first day is sunday in SQL
sql get current week start date and end date
xxxxxxxxxx
SELECT CURDATE() - INTERVAL WEEKDAY(CURDATE()) DAY AS startweek;
SELECT CURDATE() + INTERVAL (6-WEEKDAY(CURDATE())) DAY AS endweek;
xxxxxxxxxx
SELECT
DATEADD(DAY, 2 - DATEPART(WEEKDAY, GETDATE()), CAST(GETDATE() AS DATE)) [Week_Start_Date],
DATEADD(DAY, 8 - DATEPART(WEEKDAY, GETDATE()), CAST(GETDATE() AS DATE)) [Week_End_Date]