ACC1x: "Unique Values Only" Select Query Shows DuplicatesLast reviewed: May 14, 1997Article ID: Q93692 |
The information in this article applies to:
SYMPTOMSThe result of a query includes duplicate values even though you selected the Unique Values Only check box (SELECT DISTINCT) in the Query Properties dialog box.
CAUSEDuplicate values occur when both of the following conditions are met:
RESOLUTIONIn addition to SELECT DISTINCT queries, you can use GROUP BYs in a totals query to eliminate duplicates in the output. Both SELECT DISTINCT queries and GROUP BYs in a totals query are limited to 10 columns. Usually, GROUP BY is faster when the resulting data set is much smaller than the input data set, and SELECT DISTINCT is faster when there are only a few duplicates. To ensure the correct results, use GROUP BYs in a totals query instead of using the Unique Values Only query property. For example, the following two select queries give identical results:
SELECT DISTINCT [Order Details].[Order ID] FROM [Order Details]; SELECT DISTINCTROW [Order Details].[Order ID] FROM [Order Details] GROUP BY [Order Details].[Order ID]; STATUSMicrosoft has confirmed this to be a problem in Microsoft Access version 1.0. This problem was corrected in Microsoft Access version 1.1.
REFERENCESMicrosoft Access "User's Guide," version 1.0, Chapter 6, "Designing Select Queries," pages 128-130 and 142-148 |
Keywords : kbusage QryOthr
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |