title: Aggregate function in MS Access causing error
body: <p>I have an SQL query like so:</p>
  
  <pre><code>SELECT Month(mimos.mimo_date) &amp; "-" &amp; Year(mimos.mimo_date) AS monthyear, 
         Sum(Iif(mimos.amount &lt; 0, mimos.amount, 0))          AS debits, 
         Sum(Iif(mimos.amount &gt; 0, mimos.amount, 0))          AS credits 
  FROM   mimos 
  GROUP  BY monthyear, 
            debits, 
            credits; 
  </code></pre>
  
  <p>This throws the error:</p>
  
  <blockquote>
    <p>You tried to execute a query that does not include the specified
    expression ... as part of an aggregate function. (Error 3122)</p>
  </blockquote>
  
  <p>I can't seem to solve this despite extensive googling. Has anyone a solution?</p>