title: Access is telling me one of my fields isn't part of an aggregate function, but that doesn't seem to be true
body: <p>So I'm trying to run a query and I'm getting the fairly common error: </p>
  
  <pre><code>"You tried to execute a query that does not include the specified expression 'X' as part of an aggregate function"
  </code></pre>
  
  <p>, where X is the field that isn't part of an aggregate function. Normally it's a pretty straightforward error, however in my situation, there is no field specified, the error just reads: </p>
  
  <pre><code>"...specified expression '' as part of an..." 
  </code></pre>
  
  <p>I've tried to searching and can't find any other cases of this happening. The biggest thing that stumps me about this is that I was working on an example case of the exact query to try and re-create the error and while the syntax is nearly identical, the example case works perfectly fine. I've tried just copying and pasting the example case into the real file and substituting the example field names with the real ones and it's still giving me an error. I'm seriously baffled. Here is the actual SQL:</p>
  
  <pre><code>SELECT 
  
  qry_merge2_v2.Concatenate2, 
  IIf((([Second Date? (dd/mm/yyyy)] &amp; qry_merge2_v2.Concatenate2) In (SELECT qry_concatenate_dictionary.Concatenate FROM qry_concatenate_dictionary)),1,0) AS [Counter]
  
  FROM qry_merge2_v2
  
  GROUP BY qry_merge2_v2.Concatenate2, qry_merge2_v2.Period;
  </code></pre>
  
  <p>And here is the example code that I made to try and duplicate the error which actually produces no errors when it runs in its own file:</p>
  
  <pre><code>SELECT 
  
  qry_datenamerate.sName AS MerchantName, 
  IIf((([Second Date? (dd/mm/yyyy)] &amp; qry_datenamerate.sName) In (SELECT qry_namedateconcat.Concat FROM qry_namedateconcat)),1,0) AS [Counter]
  
  FROM qry_datenamerate
  
  GROUP BY qry_datenamerate.sName, qry_datenamerate.sDate;
  </code></pre>