Select Distinct

message from =?Utf-8?B?TWFnZ2ll?= on 11 May 2004
I have probably what might seem like a very simple question, but I have not been able to figure out how to do it.

I have a database that has names and addresses of members of a club I belong to. We send out a monthly newsletter. Some of the members live at the same address. I was able to "write" a macro using Select Distinct to return only distinct addresses. However, I need the rest of the information too (ie, name, city, state & zip code). How do I "combine" macros to get all the information I need.

I appreciate your help.

Thanks,
Maggie
 
=?Utf-8?B?Q29ycmluYQ==?= replied to =?Utf-8?B?TWFnZ2ll?= on 11 May 2004
Instead of using a macro, use a query (assuming your printing out mailing labels, the query can be the source for the mailing labels report). If the "name" field is the only one that might appear more than once for a given address, you might want to leave it off the query (and mailing label). Otherwise, you can have just one of the names appear.

If you leave "name" off, you can create the query with all the fields that might be duplicated for the same address (address, city, state, zip), then in the Query Properties, set Unique Values to Yes.

If you want to include just one of the names, create the query, then click the Totals button to add the Totals row. Keep "Group By" in all the fields that you are trying to eliminate duplicates for (address, city, state, zip). For the "name" field, select "First" in the Totals row.

I hope this helps. Good Luck!

Corrina Burnley
Burnley Data Solutions
www.burnleydatasolutions.com
 
Van T. Dinh replied to =?Utf-8?B?TWFnZ2ll?= on 11 May 2004
Do you have 1 Table that has both Member personal data and
Address data?

If this is the case, it is very hard to find Members that
live at the same Address since people enters Address data
differently. For example, the same address can be entered
as:

123 First Street

or

123 First St.

or

123 First St

and Access won't be able to recognise these as the same
address.

Perhaps, you need to re-structure your Database to have a
Table for Members(personal data without address details),
a Table for Addresses (just address details) and then you
link them. Even linking the above Tables, you need to
consider whether you want to set it as One (Address)-to-
Many (Members) or (depending on your use) Many (Addresses)-
to-Many (Members).

Check Access Help / Access books on One-to-Many
relationship and Many-to-Many relationship.

HTH
Van T. Dinh
MVP (Access)

question, but I have not been able to figure out how to do
it.
of a club I belong to. We send out a monthly newsletter.
Some of the members live at the same address. I was able
to "write" a macro using Select Distinct to return only
distinct addresses. However, I need the rest of the
information too (ie, name, city, state & zip code). How
do I "combine" macros to get all the information I need.
 

Archived message: Select Distinct (MS Access Database)