Returning Unique Results Only

brumshine

Registered User.
Local time
Today, 08:38
Joined
Dec 17, 2008
Messages
37
I have an access database setup with usernames and zipcodes. I'm attempting to only return zipcodes with 2 or more unique usernames in them. I am not wanting to return the zipcodes with duplicates of only a single username. What is the easiest way to acomplish this?

Thanks in advance,

BRUMSHINE
 
A simple way is to use two queries.

First create a "Distinct" query that returns a list of all the unqie ZIP / user comibations. and save this query.

Second, make a totaling query based on the first query that counts the users.. The you can use criteria of > 2 for the count.

Hope this helps ...
 
Thanks coach! This works for what I asked but there's just one more thing I'm trying to accomplish. I have other columns associated with each zip and users, for example first name and last name. I'm hoping to be able to print that information out as well however, it has to be removed during the "Distinct Query" so I can return only the zips with multiple unique users. If I attempt to run the query with those fields, It assumes I want them to be unique as well (not the case). The only fields that need to be unique are zip and user.

Thanks in advance

BRUMSHINE
 
I've figured it out! The way I got it to work was by creating a third query (I call it my master query) and linking the two other queries (distinct and count query) by the zip code field. The end product is a table of only users in the same zip code.

Hopefully this helps someone in the future.

BRUMSHINE
 
Glad you got it working. Thanks for posting your solution so other can benefit.
 

Users who are viewing this thread

Back
Top Bottom