Home > Development > MySQL – Select records matching date, ignoring the time portion

MySQL – Select records matching date, ignoring the time portion

Let us assume you have tasks scheduled for a given day in a planner. You wish to select all tasks in the given day. The following query will serve the purpose (the DATE function does the trick)


select * from task where DATE(startdatetime) = DATE('2010-05-29');
  • Share/Bookmark
Categories: Development Tags:
  1. No comments yet.
  1. No trackbacks yet.