title: php select records between 2 dates with formatted date column
body: <p>I need to select orders' records between 2 dates. the date format on the database is looks like :
  January 1, 2020 -&gt; using <code>%F %j, %Y</code> format.</p>
  <p>my try to get the records is:</p>
  <pre><code>$from_date = 'January 1, 2020';
  $to_date = 'January 5, 2020';
  
  $sql = &quot;
  SELECT * 
    FROM orders 
   WHERE order_date STR_TO_DATE(order_date, '%F %j, %Y') between STR_TO_DATE('$from_date', '%F %j, %Y') and STR_TO_DATE('$to_date', '%F %j, %Y') 
   GROUP 
      BY order_id
  &quot;;
  </code></pre>
  <p>the result is <code>null</code></p>
  <p>also I tried to use <code>convert(order_date,'%F %j, %Y')</code> but not work and shows me the same result <code>null</code></p>
  <p>hope I explain the issue clearly.</p>
  <p>Thanks</p>