Hello everyone!

We have been investing plenty of personal time and energy for many years to share our knowledge with you all. However, we now need your help to keep this blog running. All you have to do is just click one of the adverts on the site, otherwise it will sadly be taken down due to hosting etc. costs. Thank you.

Command below are used to get the first and the last day of current week.


First day


mysql> SELECT DATE_FORMAT(subdate(now(), INTERVAL weekday(now()) DAY), '%d/%m/%Y') as FirstDay;
+------------+
| FirstDay |
+------------+
| 27/04/2015 |
+------------+
1 row in set (0.00 sec)

Last day


mysql> SELECT DATE_FORMAT(adddate(now(), INTERVAL 6-weekday(now()) DAY), '%d/%m/%Y') as LastDay;
+------------+
| LastDay |
+------------+
| 03/05/2015 |
+------------+
1 row in set (0.00 sec)