title: How to have the four quarter of Year relative to a date
body: <p>I'm working on java swing application with hibernate .
  I want to show on jasperreport results for each quarter of a year (I have in database dates so I will extract years that correspond to these dates that I have on my database) I find some solutions but I think that's not really a good one ,that's the easy way:</p>
  
  <pre><code>select * from dbcheques.Cheque
  where YEAR(dateEncaissement) = '2013'
  and (MONTH(dateEncaissement) = 7
  or MONTH(dateEncaissement) = 8 or MONTH(dateEncaissement) &gt;= 9) 
  </code></pre>
  
  <p>that will return the third quarter of that year , nearly the same query for other quarter only the number change:</p>
  
  <p><strong>For the first quarter</strong></p>
  
  <pre><code>and (MONTH(dateEncaissement) = 1 or MONTH(dateEncaissement) = 2
  or MONTH(dateEncaissement) &gt;= 3) 
  </code></pre>
  
  <p><strong>For the second quarter</strong></p>
  
  <pre><code>and (MONTH(dateEncaissement) = 4 or MONTH(dateEncaissement) = 5
  or MONTH(dateEncaissement) &gt;= 6)  
  </code></pre>
  
  <p><strong>For the last quarter</strong></p>
  
  <pre><code>and (MONTH(dateEncaissement) = 10 or MONTH(dateEncaissement) = 11
  or MONTH(dateEncaissement) = 12)  
  </code></pre>
  
  <p>this is the interface: </p>
  
  <p>!(<a href="http://hpics.li/7ca6010" rel="nofollow">http://hpics.li/7ca6010</a>)</p>