Microsoft KB Archive/93299

{|
 * width="100%"|

PRB: &quot;Too Many Expressions in Distinct Output&quot; Error
'Article ID: Q93299

Creation Date: 03-DEC-1992

Revision Date: 19-SEP-1996' The information in this article applies to:


 * Microsoft Access versions 1.0 and 1.1

SYMPTOMS

An attempt to create an SQL statement in the SQL dialog box or in Access Basic fails and Microsoft Access displays the following message:

Too many expressions in DISTINCT output. CAUSE

The query contains a DISTINCT clause that lists more than ten expressions. The online Help file documents the ten-field limit as the cause of the error. However, Help provides the only documentation of this limit. The other reference, Appendix B in the Microsoft Access &quot;Language Reference,&quot; version 1.0, does not state a ten-field limit for the DISTINCT clause.

RESOLUTION

There are two methods to deal with this error message:


 * Modify the query to remove the reserved word DISTINCT.
 * Reduce the number of fields in the DISTINCT clause to ten or fewer.

One possible method to work around this error involves concatenating some of the fields into an expression when your query checks for DISTINCT rows. Each concatenation equals one DISTINCT expression. For example, substitute the code in example 1 below for the code in example 2 below. Example 1

SELECT DISTINCT table1.lname & table1.fname, table1.address,...; Example 2

SELECT DISTINCT table1.lname, table1.fname, table1.address,...; STATUS

This behavior no longer occurs in Microsoft Access version 2.0.
 * }

-

"THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY." '' ©1997 Microsoft Corporation. All rights reserved. Legal Notices.

''

Additional reference words: 1.00 1.10

KBCategory: kbusage kberrmsg kbdocerr

KBSubcategory: QryProb