title: Comparing 2 tables and displaying rows in one table not found in the other
body: <p>I want to fin the values of [stac].[Key] + SUM([stac].[Gross Sls Qty] that are not found in table n4ac. This is what I have:</p>
  
  <pre><code>SELECT [stac].[Key] + SUM([stac].[Gross Sls Qty]) 
  FROM @SoldToActuals stac
       LEFT JOIN @Node4Actuals n4ac 
            ON (([stac].[Key] + SUM([stac].[Gross Sls Qty])) = ([n4ac].[Key] + SUM([n4ac].[Gross Sls Qty])))
  WHERE [stac].[Key] + SUM([stac].[Gross Sls Qty]) IS NULL
  </code></pre>
  
  <p>Im getting this error:</p>
  
  <blockquote>
    <p>An aggregate cannot appear in an ON clause unless it is in a subquery contained in a HAVING clause or select list, and the column being aggregated is an outer reference.</p>
  </blockquote>
  
  <p>Any suggestions?</p>
  
  <p>Thanks.</p>