Friday, March 16, 2012

Get First and Last Date of the Current Week - The MySql Way

First Day of the Week

SELECT DATE_ADD(current_date, INTERVAL(1-DAYOFWEEK(current_date)) DAY) FIRST_DAY_OF_WEEK;

Last Day of the Week

SELECT DATE_ADD(current_date, INTERVAL(7-DAYOFWEEK(current_date)) DAY) LAST_DAY_OF_WEEK;