Search code examples
mysqlsql-timestamp

MySQL DATE_ADD doesn't select data


| id | title     |     start          |
| 1  | smth      | 2017-09-23 12:24:00|

I need to select the row where start = current date + 3 days.

Let's presume that current date is 2017 Sept 23.

My query is :

select * from db where db.start = DATE_ADD(curdate(), interval 3 day);

The query is running but gives no result. I am definitely sure that there is one row that corresponds select parameters. What is wrong with my query?


Solution

  • select * from db where DATE(db.start) = DATE_ADD(curdate(), interval 3 day);