title: MS Access error, aggregate function
body: <p>I am trying to run the sql query below in access. I keep getting the MS Access error:</p>
  
  <blockquote>
    <p>"You tried to execute a query that does not include the specified expression 'ID' as part of an aggregate function"</p>
  </blockquote>
  
  <p>The query I wrote is as below:</p>
  
  <pre><code>SELECT Subject.ID, Subject.Description, Max(DataSets.ID) AS ID_DataSets
  FROM Subject 
  INNER JOIN DataSets ON Subject.Description = DataSets.Subject.Value
  GROUP BY Subject.ID, Subject.Description;
  </code></pre>