943,751 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 459
  • C# RSS
Sep 15th, 2008
0

SQL Query - Filtering Address

Expand Post »
Hi Guys

I hope you can help share some light on my problem.

Basically, I have a MS Access table...ID, firstname, surname, Address1, Address2 etc

What I want to do is Select all from table but only show one record where more than one person lives at that address .. Eg only sending one envelope to the one household rather than sending two to the same address ....

I wouldnt have thought it was overly complex, however the combinations that I have been trying from the query builder havent worked ..

I can get a count of the number of records where the same address exists but I can't display a first name aswell.

Your suggestions will be greatly welcomed ... Thanks

Elmo
Last edited by Elmo_loves_you; Sep 15th, 2008 at 12:40 pm. Reason: spelling error
Reputation Points: 30
Solved Threads: 0
Junior Poster in Training
Elmo_loves_you is offline Offline
85 posts
since Mar 2008
Sep 15th, 2008
0

Re: SQL Query - Filtering Address

count items by the address lines or postcode or whatever you decide is the same name, then where records have a count > 2 you join them with a select on name where the address lines = the lines which had more than 2 records.
Reputation Points: 196
Solved Threads: 190
Posting Virtuoso
LizR is offline Offline
1,735 posts
since Aug 2008
Sep 15th, 2008
0

Re: SQL Query - Filtering Address

you could also use a group by for your address criteria

http://office.microsoft.com/en-us/ac...314821033.aspx
Reputation Points: 133
Solved Threads: 141
Veteran Poster
dickersonka is offline Offline
1,162 posts
since Aug 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: c# and phidget RFID
Next Thread in C# Forum Timeline: Stupid Question





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC