title: Access 2007 error in wizard generated query for finding duplicates
body: <p>I'm trying to use the query wizard to generate a query for finding duplicate records. The query generated worked fine with a table, but when I apply the wizard again to run find duplicates in a query I keep getting this error:
  : "you tried to execute a query that does not include the specified expression...as part of an aggregate function".
  here is the SQL generated by the wizard:</p>
  
  <pre><code>SELECT [four letter c-codes].[4_letter_code], [four letter c-codes].[bird_data_ID], [four letter c-codes].[Metal_ID]
  FROM [four letter c-codes]
  WHERE ((([four letter c-codes].[4_letter_code]) In (SELECT [4_letter_code] FROM [four letter c-codes] As Tmp GROUP BY [4_letter_code] HAVING Count(*)&gt;1 )))
  ORDER BY [four letter c-codes].[4_letter_code];
  </code></pre>
  
  <p>I tried to execute the In clause separately and it worked, outputting the duplicate values for field [4_letter_code]. Replacing the In clause by the constants yielded thereby also gave the desired output.
  Would appreciate any help to solve this problem...</p>