There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Business Applications
Tag Cloud
audio bios blue screen boot bsod computer connection crash dcom dell driver drivers email error excel firefox google hard drive hardware hijackthis internet laptop logon logs off macro malware microsoft motherboard network networking problem ram recovery router screen slow software sound trojan usb userinit.exe virus vista webcam wifi windows windows 7 windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications >
Access 2003 Query Duplicates Question

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
bobbi's Avatar
Senior Member with 344 posts.
 
Join Date: Dec 2000
Location: Westminster, MD USA
18-Apr-2007, 09:43 AM #1
Access 2003 Query Duplicates Question
Hi

I have a question about removing duplicate records in query and report output.

Here is the overview. We have a database of Summer Campers. Several of the campers are children from the same house hold.

I have a query which adds all the kids to one postcard to be sent out. Then another query which runs the labels to be put on the postcard for mailing.

When I run the labels, each record (for each child) is a result. So I may have 2, 3 or even 4 lables for the same address. I only have one postcard.

I tried using the unique values and unique fields in the properties of the query but that does not work. I also tried saying "hide duplicates" in the report but that is per field so it will hide the address but leave the city state and zip. Of course I can't hide those because other people live in that same city, state etc.

I do not want to delete the duplicate records because they are each different kids in different sessions of camp. I just want to be able to print out one label per address.

Any ideas?
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 9,738 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
18-Apr-2007, 12:07 PM #2
bobbi, how about running a query with just the Post (Zip) Code, in, set to unique values.
Then run a second query which has the first query as it's "table", add the original table of names and addresses, with the link between the (code) query and the address table set to Post Code and all the records from the Code query but only the matching records from the Addresses table. This should be set to Unique Records as well.
If you could post a zipped copy of the database I could probably do it for you.
__________________
OBP
I do not give up easily
bobbi's Avatar
Senior Member with 344 posts.
 
Join Date: Dec 2000
Location: Westminster, MD USA
18-Apr-2007, 12:09 PM #3
I'll try that.

The DB is at a remote site, nature center, and they are on dial up. I would need to go get the database. I'll give it a try, if I can't do it I'l take you up on your offer.

Thanks
cristobal03's Avatar
Distinguished Member with 2,994 posts.
 
Join Date: Aug 2005
Experience: Advanced
18-Apr-2007, 01:01 PM #4
The underlying problem is an issue with the database structure. It isn't normalized, I would assume, if you have as many as four address records that are exactly the same. I bet the reason you haven't seen the UNIQUE constraints work in your query is because there are no foreign keys in the tables on which to apply the constraints.

For the record I would strongly advise against posting a database on this site that contains private information about kids' addresses and so forth. If that's the way you want to go, send a private message to OBP and work things out through email.

chris.
bobbi's Avatar
Senior Member with 344 posts.
 
Join Date: Dec 2000
Location: Westminster, MD USA
18-Apr-2007, 01:17 PM #5
Yes, thank you for that information. I had already contacted OBP privately because of that very reason...I didn't want to put kids names and addresses out there. But I appreaciate the warning.
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 9,738 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
19-Apr-2007, 11:40 AM #6
bobbi, any success?
tssells's Avatar
Computer Specs
Member with 31 posts.
 
Join Date: Apr 2007
Experience: I remember DOS operating systems!!!
20-Apr-2007, 01:20 AM #7
Try using the distinct function in your query.
Closed Thread Bookmark and Share   techguy.org/563655

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 04:28 PM.
Copyright © 1996 - 2010 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.