You may receive a "Cannot group on fields selected with '*'" error message when you run a query in Access (835414)
The information in this article applies to:
- Microsoft Office Access 2003
- Microsoft Access 2002
- Microsoft Access 2000
This article applies only to a
Microsoft Access database (.mdb). Moderate: Requires basic macro,
coding, and interoperability skills.
For a Microsoft Access 97 version of this article, see 103189.
SYMPTOMSWhen you run a query in a Microsoft Access database that
uses one of the aggregate (totals) functions such as the Sum() aggregate function, the Min() aggregate function, or the Max()
aggregate function, the query may not run successfully. You may receive the following
error message: Cannot group on fields selected with
'*'. CAUSEThis problem occurs when you use one of the aggregate (totals)
functions in your query, and you do not set the Output All Fields
query property to No. When you set the Output All Fields query
property to Yes, an asterisk (*) wildcard character that represents all columns
of the database table is added to the select clause of the Access query. However,
you cannot have an asterisk (*) wildcard character together with an aggregate
function in the select clause of the Access query. Therefore, when you run the
Access query, you may receive the error message that is mentioned in the "Symptoms" section.RESOLUTIONTo resolve this problem, set the Output All Fields query property to No and then run the Access query that uses one of the aggregate (totals) functions.
To do this, follow these steps:
- Start Access.
- Open the Access database that contains the problem
query.
- In the Database window, click Queries under the Objects
section.
- In the right pane, right-click the problem query, and then
click Design View.
- Click anywhere in the Query window outside the query grid
and outside the field lists.
- On the View menu, click
Properties.
- In the Query Properties dialog box, set
the value of the Output All Fields query property to
No.
- On the
Query menu, click Run.
REFERENCES
For more information about the Output All Fields query
property in Access 2000 and Access 2002, click Microsoft Access Help on the Help menu, type Setting query properties in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.
For more information about the Output All Fields query
property in Access 2003, click Microsoft Office Access Help on the Help menu, type Customize the display of fields in a query (.mdb) in the Search for box in the Assistance pane, and then click Start searching to view the topic.
Modification Type: | Minor | Last Reviewed: | 6/9/2004 |
---|
Keywords: | kbProperties kbDatabase kbQuery kberrmsg kbprb KB835414 kbAudDeveloper |
---|
|