title: MySQL get records by quarters
body: <p>Have problem to returning results from MySQL by quarters.</p>
  
  <p>Mysql:
  <code>id</code>, <code>start_datetime</code>, <code>end_datetime</code> and more columns. </p>
  
  <p>I need to return records by start_datetime (for example it's - <code>2016-03-05 20:12:22</code> | MySQL column format is DateTime). How can I write MySQL query to display that record in a specific quarter?</p>
  
  <p>I was searching a lot but didn't find anything that would work fo me: I tested this:</p>
  
  <pre><code>SELECT * FROM appointments 
  WHERE id_user = 80 
  AND DATE_SUB(start_datetime, INTERVAL 1 QUARTER) 
  AND hash = 'completed' 
  </code></pre>
  
  <p>But it's not working correct.</p>