I need a way of changing the format the date format from datetime to just the date in an SQL query, I have tried:
$sql="SELECT created_by FROM meetings WHERE STR_TO_DATE('date_start', 'Y-m-d')='$CorrectDate'";
but to no avail.
date_start is the field in the SQL table.
Any help welcome!!!
Unlike any solution which involves a function or an expression over
date_start
, this one is sargable, i. e. able to use an index ondate_start
efficiently.