title: MySQL: Get the datetime field with time part reset to midnight (00:00:00)?
body: <p>I am trying to query the <code>PurchaseDate</code> datetime column from <code>tmp</code> table along with a custom column that is <code>PurchaseDate</code> column with time as 00:00:00 / midnight:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>PurchaseDate</th>
  <th>StartOfDay</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1996-07-16 20:00:00</td>
  <td>1996-07-16 00:00:00</td>
  </tr>
  <tr>
  <td>1996-07-10 21:19:00</td>
  <td>1996-07-10 00:00:00</td>
  </tr>
  <tr>
  <td>1996-07-12 22:18:00</td>
  <td>1996-07-12 00:00:00</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I wasn't able to do it using <code>DATEDIFF()</code>. How can I do it in the simplest way?</p>
  <p>As suggested, I have tried using <code>date()</code>. However that converts the column type to date and I would like to retain it as a datetime.</p>