title: SQL - Group By not working in this code
body: <pre><code>TRANSFORM Count(Details.Customer_ID) AS CountOfCustomer_ID
  SELECT
    Switch(
      [Age] &lt; 25,                  "Under 25",
      [Age] &gt;= 25 And [Age] &lt;= 32, "Between 25 And 32",
      [Age] &gt;= 32 And [Age] &lt;= 40, "Between 32 And 40",
      [Age] &gt;= 40 And [Age] &lt;= 45, "Between 40 And 45",
      [Age] &gt; 45,                  "Over 45"
    ) AS Age_Range
  FROM Details
    INNER JOIN [Account Status] ON Details.Customer_ID = [Account Status].Customer_ID
  WHERE ((([Account Status].Account_Status)='Active'))
  GROUP BY Details.Age, [Account Status].Account_Status
  PIVOT Details.site;
  </code></pre>
  
  <p>My results are counting Active accounts like this:</p>
  
  <pre><code>Age Range          Site 1  Site 2  Site 3
  -----------------  ------  ------  ------
  Under 25                   1
  Under 25                   1
  Between 25 And 32                  1
  Between 25 And 32                  1
  Between 25 And 32                  1
  Between 25 And 32                  1
  </code></pre>
  
  <p>When it should be like this:</p>
  
  <pre><code>Age Range          Site 1  Site 2  Site 3
  -----------------  ------  ------  ------
  Under 25                   2
  Between 25 And 32                  4
  </code></pre>
  
  <p>I have tried grouping by the Switch statement as well and it does not work. Please help.</p>