title: Using GROUP BY aggregating SUM on a calculated column
body: <p>I tried asking this question earlier and now I found a more consolidated way of asking this question.</p>
  
  <p>I'm working in Access 2007.</p>
  
  <p>I have a query of the following format in Access:</p>
  
  <pre><code>SELECT RecDate, Weight * YTD / (SELECT SUM(Weight) From Records 
  WHERE Class1=t2.Class1 AND Class2 = t2.Class2) as AdjYield
  From Records as t2
  WHERE Class1="fi" AND Class2="ra"
  </code></pre>
  
  <p>It gives me the following result</p>
  
  <pre><code>RecDate AdjYield
  11/27/2012  4.73704622309864E-05
  11/27/2012  0
  11/27/2012  -1.87533613791046E-04
  11/27/2012  -2.4014644030909E-05
  11/27/2012  1.29986083977377E-04
  11/27/2012  1.2765190817936E-04
  12/11/2012  1.10288780895771E-04
  12/11/2012  0
  12/11/2012  -1.7463943470934E-04
  12/11/2012  -1.51778890534467E-05
  12/11/2012  1.47374111584102E-04
  12/11/2012  1.45120288096115E-04
  </code></pre>
  
  <p>Now I want the SUM of each day's calculated AdjYield</p>
  
  <pre><code>RecDate AdJYield
  11/27/2012, 1.557E-05
  12/11/2012, 3.549E-05
  </code></pre>
  
  <p>I tried putting SUM() around the <code>Weight * YTD / (SELECT SUM(Weight) From Records WHERE Class1=t2.Class1 AND Class2 = t2.Class2) as AdjYield</code> part and then adding <code>GROUP BY RecDate</code> in the end. However I get an error saying </p>
  
  <blockquote>
    <p>You tried to execute a query that does not include the specified expression "Class1" as part of an aggregate function.</p>
  </blockquote>
  
  <p>Any idea on how to do this aggregate correctly?</p>