shevabam
1/9/2015 - 7:30 AM

SQL - Get first and last day (monday/sunday) in a date

SQL - Get first and last day (monday/sunday) in a date

SELECT
    DATE_ADD(CURRENT_DATE, INTERVAL(2-DAYOFWEEK(CURRENT_DATE)) DAY) AS start_day,
    DATE_ADD(CURRENT_DATE, INTERVAL(8-DAYOFWEEK(CURRENT_DATE)) DAY) AS end_day;