May 11

Microsoft Access Queries: “Unique Values” (DISTINCT) vs. “Unique Records” (DISTINCTROW)

When creating queries in Access, you may have noticed the query properties “Unique Values” and “Unique Records”. Are you familiar with the difference between these properties?

“Unique Values” and “Unique Records” correspond with the DISTINCT and DISTINCTROW statements (respectively) in the query’s SQL. Although they sometimes provide the same results, there are significant differences in how they work:

  • DISTINCT checks for unique values only in the fields selected for output, and eliminates duplicate rows. Results are not updatable, since they do not necessarily correspond with a unique record.
  • DISTINCTROW checks for unique values in all fields in the table that you are querying, not just the fields listed for output. If the table is keyed, the results are updatable, since they correspond with a single record in the underlying data.

Learn more and view an example of the differences in our new paper on Microsoft Access Queries: Distinct versus DistinctRow.

Visit ourĀ Microsoft Access Query Help CenterĀ for more query tips.