Select the product you need help with
Error message when you run a query in Access: "Cannot group on fields selected with '*'"Article ID: 835414 - View products that this article applies to. This article applies to a Microsoft Access database (.mdb) file or to a Microsoft Access database (.accdb) file. Moderate: Requires basic macro,
coding, and interoperability skills.
For a Microsoft Access 97 version of this article, see 103189
(http://support.microsoft.com/kb/103189/
)
.
On This PageSYMPTOMSYou may receive an error message when you run a query in a Microsoft Access database that
uses one of the following aggregate functions:
Cannot group on fields selected with
'*'. CAUSEThis problem occurs when you use aggregate
functions in the query, and you do not set the Output All Fieldsproperty of the query to No. When you set the Output All Fieldsproperty of the query 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
property of the query to No, and then run the Access query that uses an aggregate function.
To do this, follow these steps:
MORE INFORMATIONYou can use the Output all
fields option to automatically include all the fields from
the underlying tables in the results of the final query. You can also use the Output all
fields option to automatically include all the fields from the queries in the results of the final query. When you do this, you do not have to add all the fields from
the underlying tables or all the fields from the queries to
the design grid. To do this in Access 2003 and in earlier versions of Access, follow these steps:
Steps to reproduce the problem in Access 2003
PropertiesArticle ID: 835414 - Last Review: September 17, 2011 - Revision: 3.0 APPLIES TO
| Article Translations |


Back to the top








