SQL Query - Filtering Address

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2008
Posts: 83
Reputation: Elmo_loves_you is an unknown quantity at this point 
Solved Threads: 0
Elmo_loves_you's Avatar
Elmo_loves_you Elmo_loves_you is offline Offline
Junior Poster in Training

SQL Query - Filtering Address

 
0
  #1
Sep 15th, 2008
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
Michelle (Junior Developer)
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: SQL Query - Filtering Address

 
0
  #2
Sep 15th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,160
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: SQL Query - Filtering Address

 
0
  #3
Sep 15th, 2008
you could also use a group by for your address criteria

http://office.microsoft.com/en-us/ac...314821033.aspx
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC