Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old September 1st, 2003, 03:54 AM
Abduh Abduh is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 3 Abduh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question mailing list.

Hello,
I'm still a learner. I need help on my ms access.

I have a mailing list, in my query, for newsletter distribution. But some recipients on that list have the same address, i.e., they are families.
How to generate a list that could display all similar address into one label, but with all the respective names on it?

If this can be done, I could save alot on postages.

Thanks.

Reply With Quote
  #2  
Old September 3rd, 2003, 01:22 PM
siredge siredge is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Boise, ID
Posts: 9 siredge User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Head of Household

Would it be enough to say something like Bob Smith and Family?

If so, is there a way of determining who the head of the household is (age field, the one with the smallest identifier, etc.?)

Reply With Quote
  #3  
Old September 3rd, 2003, 08:42 PM
Abduh Abduh is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 3 Abduh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Bob smith and family, would be good. but how to do it?
The only thing that is common among them is their addresses and not last names.
thanks.

Reply With Quote
  #4  
Old September 4th, 2003, 11:10 AM
siredge siredge is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Boise, ID
Posts: 9 siredge User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Couple of questions:
1) How are the names arranged in the table? (one field or two)
2) Do you have any preference as to which of the people at the given address it is addressed to?
2a) Is there a designation in the database that we can find to match that preference?

Reply With Quote
  #5  
Old September 4th, 2003, 11:22 AM
siredge siredge is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Boise, ID
Posts: 9 siredge User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
SELECT (first_name || ' ' || last_name || ' and Family') AS Household

This is Oracle SQL. You may need to adjust the single quotes to double quotes or something similiar. This doesn't break it down to a single person at each address, but it's a start

Reply With Quote
  #6  
Old September 4th, 2003, 09:47 PM
Abduh Abduh is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 3 Abduh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
The fields are as follows, NAME, ADDRESS, POSTAL CODE, MEMBERS NO.(primary key). Its not important to display the name of head of the house on the label. it does'nt matter if there is no name at all.

presently, I make a copy of the file. Sort according to address. Hence, those with the same address are grouped together. Then I would delete all entry from the same house, but sparing one.

Anyway, to answer yr question:
1. One field
2. & 2a. No.

Thanks.

Reply With Quote
  #7  
Old September 5th, 2003, 10:06 AM
siredge siredge is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Boise, ID
Posts: 9 siredge User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
SELECT DISTINCT Address,
postal_code
FROM MailingListTableName

will give you only one occurance of each address... but if you put in that select alias from the previous post, you'll get each person rather than individual addresses.. sounds like you might have to write a function to sort them and pick one.

You can probably use VB to write a function to perform a single name match on the query above to give you a name and street address.

Reply With Quote
  #8  
Old September 5th, 2003, 02:30 PM
crimson117 crimson117 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: New York
Posts: 19 crimson117 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to crimson117 Send a message via AIM to crimson117 Send a message via Yahoo to crimson117
The problem is that you're storing the same Address data multiple times. If having multiple members be associated with one common address is a requirement of your database, then you shouldn't store it all in a single table.

Make a separate "Address" table, and add a foreign-key onto the Member table which points to the Address table:

Code:
MEMBER TABLE
Name Addr_Ref
John 1001
Luke 1002
Suze 1001
Josh 1003

ADDRESS TABLE
Addr_Ref  Address
1001      100 Main Street
1002      200 Brook Road
1003      8 Clearview Way


To get all members and their addresses, do

SELECT member.name, address.address from member, address where address.addr_ref = member.addr_ref;


To get a list of unique addresses, do these two queries inside a report:

SELECT distinct member.addr_ref as curr_AddrRef, Address.address from Member, Address where address.addr_ref = member.addr_ref;

For each record that you get, run a subreport, linked on addr_ref, using this query:

SELECT Member.name from member where member.addr_ref = currAddrRef;


Your report would look something like:
Code:
  100 Main Street
        -John
        -Suze

  200 Brook Road
        -Luke

  8 Clearview Way
        -Josh

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > mailing list.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway