title: Group by datepart and find total count of individual values of each record
body: <p>This is table structure;</p>
  
  <pre><code>ID  Score  Valid    CreatedDate
  1   A      1        2018-02-19 23:33:10.297
  2   C      0        2018-02-19 23:32:40.700
  3   B      1        2018-02-19 23:32:30.247
  4   A      1        2018-02-19 23:31:37.153
  5   B      0        2018-02-19 23:25:08.667
  ...
  </code></pre>
  
  <p>I need to find total number of each score and valid in each month</p>
  
  <p>I mean final result should be like </p>
  
  <pre><code>Month    A     B     C     D   E   Valid(1) NotValid(0) 
  January  123   343   1021  98  12  1287     480
  February 516   421   321   441 421 987      672   
  ...
  </code></pre>
  
  <p>This is what I tried;</p>
  
  <pre><code>SELECT DATEPART(year, CreatedDate) as Ay,
  (select count(*) from TableResults where Score='A') as 'A',
  (select count(*) from TableResults where Score='B') as 'B',
  ...
    FROM TableResults 
    group by DATEPART(MONTH, CreatedDate)
  </code></pre>
  
  <p>but couldn't figure how to calculate all occurrence of scores on each month.</p>