Microsoft KB Archive/98808

{|
 * width="100%"|

ACC1x:  Not Part of Aggregate Function or Grouping

 * }

Q98808

-

The information in this article applies to:


 * Microsoft Access versions 1.0, 1.1

-

SYMPTOMS
If a select query that contains an expression is converted to a totals query, the following error message is displayed when the query is run:

not part of aggregate function or grouping.

CAUSE
When a select query is converted to a totals query, all expressions are assumed to contain aggregate functions and cause the Total field to default to Expression.

RESOLUTION
To work around this problem, set the Total field to Expression and include an aggregate function as part of the expression for Field Name. If you cannot add an aggregate function, set Total to Group By as shown:

  Query: Query Name Field Name: Total: Group By

STATUS
This behavior no longer occurs in Microsoft Access version 2.0.

Steps to Reproduce Behavior
Using the sample database NWIND.MDB, complete the following steps:

 Open the Employee List query in Design view by choosing the Query button in the Database window, selecting the query name, and choosing Design. From the View menu, choose Totals to convert the query to a totals query.  From the Query menu, choose Run. The following error message is displayed:

&quot;[Last Name] & &quot;, &quot; & [First Name]&quot; not part of aggregate function or grouping.

  In the query grid, make the following changes:

    Query: Employee List ---    Field name: Employee Name:[Last Name] & &quot;, &quot; & [First Name] Total: Group By 