Applies To Action query, Select query.
Description
You can use the UniqueValues property when you want to omit records that contain duplicate data in the fields displayed in Datasheet view. For example, if a query's output includes more than one field, the combination of values from all fields must be unique for a given record to be included in the results.
Note The UniqueValues property applies only to append and make-table action queries and select queries.Setting
The UniqueValues property uses the following settings.
Setting | Description |
Yes | Displays only the records in which the values of all fields displayed in Datasheet view are unique. |
No | (Default) Displays all records. |
See Also ALL, DISTINCT, DISTINCTROW, TOP predicates ("SQL Language Reference"), UniqueRecords property.
Example The SELECT statement in this example returns a list of the countries in which there are customers. Because there may be many customers in each country, many records could have the same country in the Customers table. However, each country is represented only once in the query results. This example uses the Customers table, which contains the following data.Country | Company name |
Brazil | Familia Arquibaldo |
Brazil | Gourmet Lanchonetes |
Brazil | Hanari Carnes |
France | Du monde entier |
France | Folies gourmandes |
Germany | Frankenversand |
Ireland | Hungry Owl All-Night Grocers |
SELECT DISTINCT Customers.Country
FROM Customers;
Countries returned |
Brazil |
France |
Germany |
Ireland |