# For current week
select curdate() - interval weekday(curdate()) day as `Monday of week`;
select curdate() + interval (6-weekday(curdate())) day as `Sunday of week`;
# For specific date: 2012-10-20
select '2012-10-20' - interval weekday('2012-10-20') day as `Monday of week`;
select '2012-10-20' + interval (6-weekday('2012-10-20')) day as `Sunday of week`;
Title:
MySQL get first and last day of week
Description:
# For current week select curdate() - interval weekday(curdate()) day as `Monday of week`; select curdate() + interval (6-weekday(curdate(...
...
Rating:
4