Query: Retrieving unique values?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

From Query Design View, what do I need to do to extract unique values only?
 
Ann -

Lookup the Distinct predicate in the help file. Example:

SELECT DISTINCT Customers.Country
FROM Customers;

You'll need to add this in manually in SQL view.

Bob
 
Ann -

Lookup the Distinct predicate in the help file. Example:

SELECT DISTINCT Customers.Country
FROM Customers;

You'll need to add this in manually in SQL view.

Bob


When in design view, right click on the top portion on the window and
choose properties.
There are two properties you can set to yes or no - Unique Values and
Unique Records.
Just in case you don't want to attempt modify a sql string directly.
 
You have three choices.

1. Got to View, SQL view, and put the word "DISTINCT" right after "SELECT"
SELECT DISTINCT

2. Got to the menu and select View, Totals.

3. Right click in the design area and select either Distinct Values or
Distinct Records.
There is a difference between the two. Values shows unique records based
on what is returned in the query, while Records looks into the table. If you
don't return all the fields in the table(s) it may look like duplicates
returned if you use Records.

I like #2 myself but will use #1 at times. Seldom used option #3.
 
Thank-you for this email.

From the Design View, I selected the fileds. When I viw SQL View, can you
tell me where I would insert SELECT DISTINCT?

Attached is what appears in the SQL View.

SELECT [MS Access Service Providers].[Office Master], [MS Access Service
Providers].[Service Category], [MS Access Service Providers].[Service Type],
[MS Access Service Providers].[Vendor Name] INTO [LOC Service Types 3 5 07]

FROM [MS Access Service Providers];

Thanks,
-Ann
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top