ACC1x: DISTINCTROW Keyword Ignored in a Cartesian Product

Last reviewed: May 14, 1997
Article ID: Q103133
The information in this article applies to:
  • Microsoft Access version 1.1

SYMPTOMS

Your query dynaset includes duplicate records, which should have been eliminated by the presence of the keyword DISTINCTROW.

CAUSE

This problem occurs if no join is specified between the tables in the query.

RESOLUTION

To hide the duplicate records, verify that the query output includes one field that uniquely identifies each record, then replace the keyword DISTINCTROW with the keyword DISTINCT.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version 1.1. This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Open the sample database NWIND.MDB.

  2. Create a new query based on the Customers and Orders tables. Join the tables on the Customer ID field.

  3. Drag the Contact Name field to the query grid and run the query. Note that your dynaset contains 90 records.

  4. Switch to Design view and delete the join line between the tables.

  5. Add the following criteria in the Contact Name field on the query grid:

          Customers.[Customer ID] = Orders.[Customer ID]
    

  6. Run the query. The dynaset now contains 1078 records. Contact names from companies that have placed multiple orders are displayed multiple times.

REFERENCES

Search for "ALL," "DISTINCT," "DISTINCTROW," and "Predicates (SQL)" using the Microsoft Access Help menu.

Microsoft Access "User's Guide," version 1.1, page 187


Additional query words: relationship many-to-many duplicates
Keywords : kbusage QryJoin
Version : 1.1
Platform : WINDOWS
Hardware : X86
Issue type : kbbug
Resolution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" 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.

Last reviewed: May 14, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.