title: Running a select statement for each case
body: <p>I'm a complete SQL novice. I want to display a simple grid.....</p>
  
  <ol>
  <li><strong>Sign up......>30.....30-60.....60-90.....>90.....Total</strong></li>
  <li><strong>Feb</strong>...............4..........30...........      6      ......... 0     .......40</li>
  <li><strong>Mar</strong>   ............. 0 .........11      ...........1       ..........4     .......16</li>
  <li><strong>Apr</strong></li>
  <li><strong>May</strong>          etc</li>
  <li><strong>Jun</strong>                         etc</li>
  </ol>
  
  <p>Where <strong>total</strong> represents the total of number of customer sign ups per month, and where the likes of '30-60' represents the number sign ups on the date 30-60 days since today's date </p>
  
  <p>The query I am using is as follows......</p>
  
  <pre><code>SELECT case MONTH(Datecreated)
  when   2 then 'Febrary'
  when   3 then 'March'
  when   4 then 'April'
  when   5 then 'May'
  when   6 then 'June'
  end as 'Signup Month',
  
  
  (select count(*) from WS_USER_DETAILS where datediff(day, datecreated, GETUTCDATE()) &lt; 30 )  as  '&lt;= 30 days',
  (select count(*) from WS_USER_DETAILS where datediff(day, datecreated, GETUTCDATE()) between 30 and 60) as  '&lt;= 60 days',
  (select count(*) from WS_USER_DETAILS where datediff(day, datecreated, GETUTCDATE()) between 60 and 90) as  '&lt;= 90 days',
  (select count(*) from WS_USER_DETAILS where datediff(day, datecreated, GETUTCDATE()) &gt;90) as  '&lt;= 120 days', 
  
  count(userid) AS 'Total' FROM WS_USER_DETAILS
  
  
  group by MONTH(Datecreated)
  </code></pre>
  
  <p>The problem I have is....
  I want to run the select statements for each month. However it populates all months. For example......</p>
  
  <ol>
  <li><strong>Sign up......>30.....30-60.....60-90.....>90.....Total</strong></li>
  <li><strong>Feb</strong>...............0..........11...........      1      ......... 4     .......40</li>
  <li><strong>Mar</strong>   ............. 0 .........11      ...........1       ..........4     .......16</li>
  </ol>
  
  <p>If possible can someone advise me on how to run the select statements for each month? Thanks</p>