title: Select with count by months
body: <p>I have Pickup table and trying to write a report which will show me how many pickups were in each month in a year.<br/>
  It should looks like this <br/>
  <img src="https://i.stack.imgur.com/1GFHk.jpg" alt="enter image description here"></p>
  
  <p>I so far  i have this </p>
  
  <pre><code>  SELECT
  DATEPART(MONTH, PickupDate)as 'Month',
  count (CASE WHEN DATEPART(YEAR, PickupDate) = 2012 THEN 1 ELSE 0 end)as 'Pickups'
  ,count (CASE WHEN CategCode  = 'NB' and DATEPART(YEAR, PickupDate) = 2012  THEN 1 ELSE 0 end) as 'Newborn'
  FROM dbo.Pickup 
  where DATEPART(YEAR, PickupDate) = 2012
  group by DATEPART(MONTH, PickupDate)
  
  WITH ROLLUP
  </code></pre>
  
  <p>I cannot figure out how to calculate Newborn column, any ideas?
  My query  so far calculate not right it just count all pickup from pickup table.<br/>
  <img src="https://i.stack.imgur.com/rzBR9.jpg" alt="enter image description here"></p>