In my table I have a field named eventdate
in datetime
format like 2010-05-11 00:00:00
.
How do i make a query so that it adds
You can use the DATE_ADD() function:
... WHERE DATE(DATE_ADD(eventdate, INTERVAL -1 DAY)) = CURRENT_DATE
It can also be used in the SELECT
statement:
SELECT DATE_ADD('2010-05-11', INTERVAL 1 DAY) AS Tomorrow;
+------------+
| Tomorrow |
+------------+
| 2010-05-12 |
+------------+
1 row in set (0.00 sec)