title: Grouping values by month and by quarter
body: <p>I have data like </p>
  
  <p>MyTable</p>
  
  <pre><code>person   datetimeField   datavalue1
   a        20110104        3
   a2       20110105        2 
   b        20110302        5
   c        20110403        6
   d        20110605        2
  </code></pre>
  
  <p>The final result should look like:  (Order isn't important)</p>
  
  <pre><code> DatePart    SumDatavalue1
   January      5
   March        5
   April        6
   June         2
   Quarter1     10
   Quarter2     8
  </code></pre>
  
  <p>The only way I can think of is to use two separate select statements with GROUP BYs and then doing a UNION ALL. Is there a more efficient way? </p>
  
  <p>Edit: I should say that there may be another column, datavalue2, that would need to be averaged, instead of summed. Not sure if that makes a difference.</p>