title: Group by month and year given yyyy-mm-dd as a date
body: <p>I have a list of incidents and dates along with them, yyyy-mm-dd then a category.</p>
  
  <p>I need to order by the category (speeding tickets, DUIs, etc...) for each month in a year.</p>
  
  <p>This is what the two columns look like</p>
  
  <pre><code>2002-12-28  No Driver License
  2002-12-28  Hazardous Violations
  2002-12-28
  2002-12-28  Speeding    
  2002-12-28  DUI
  2002-12-28  Reckless Driving
  2002-12-28      
  2002-12-28  Speeding
  </code></pre>
  
  <p>And here is what I have so far</p>
  
  <pre><code>SELECT
       [Date]
      ,[categoryId]   
       = (SELECT tertiary FROM [MSDAS].[dbo].[activity_categories] AS C 
          WHERE C.categoryId = A.categoryId)
      ,[value]
  
  FROM [MSDAS].[dbo].[hp_activities] AS A 
      JOIN [MSDAS].[dbo].[workdays] AS W ON W.workdaysId = A.workdaysId
  
  WHERE W.date IS NOT NULL 
      AND W.date &gt;= '2002/1/1'
  
  ORDER BY Date
  </code></pre>