Newbie: filtering out duplicates

  • Thread starter Thread starter icsottawa
  • Start date Start date
I

icsottawa

I have a database where the fields are: address, city, postal code

My records include many entries of the same city. How can I create a
query which will give me a list of all the cities in my database but
filter out all other city duplicates except for one example of each
city?

Thanks to all...Carlos
 
icsottawa said:
I have a database where the fields are: address, city, postal code

My records include many entries of the same city. How can I create a
query which will give me a list of all the cities in my database but
filter out all other city duplicates except for one example of each
city?


SELECT DISTINCT City
FROM yourtable
 
The SQL for the query would look like:

SELECT DISTINCT [CityName]
FROM [YourTable]

In the query design view
-- add your table
-- add the city field
-- Select View: Properties
-- If the query properties aren't showing, then click anywhere in the
blank area in the top section of the design view
-- Set the Unique Values property of the QUERY to Yes


'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 

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