I want to display the days in a month grouping by week, that's what I did.
select date(subdate(table1.date1, interval (dayofweek(table1.date1)-2)day)) as OverWeek,count(table1.Id) from table1 where YEAR(table1.date1 ) = YEAR(CURDATE()) AND MONTHNAME(table1.date1) = "June" GROUP BY OverWeek
But for June it shows me 1 July . I guess' cause on 1 July , it's a Monday, but I do not know how to solve this porblème.
Thank you in advance
For June for exemple
+------------+ | dt | +------------+ | 2013-06-01 | | 2013-06-08 | | 2013-06-15| | 2013-06-22 | | 2013-06-29 | +------------+
and 2013-06-01 group 2013-06-01 up to 2013-06-07 and 2013-06-08 group 2013-06-08 up to 2013-06-14 ....