Oleg Mikhailov Oleg Mikhailov - 6 months ago 8
MySQL Question

MySQL: select date of current week's monday

I'm building a weekly report using MySQL queries. First I get week number by

SELECT WEEK(CURDATE());


Then I need to display the starting date of the week (Monday for my region). How to do it with MySQL only?

Answer

If you need date of monday in current week try this:

SELECT DATE_ADD(CURDATE(), INTERVAL - WEEKDAY(CURDATE()) DAY)

It return you monday date of current week.