Pulling Data from Multiple Tables

tmulrooney

Registered User.
Local time
Today, 18:03
Joined
Mar 8, 2002
Messages
23
I have three tables. Each table has a list of names and birthdays. I need to query a list of all birthdays from all three tables. Can this be done?

Thanks,
Tim
 
You could use the Union operator:

SELECT Name, Birthday
FROM YourTable1
UNION
SELECT Name, Birthday
FROM YourTable2
SELECT Name, Birthday
FROM YourTable3;

Adapt this statement for the names of your table fields and your tablenames.

By the way, why are you using three tables, not one?

Suc6,

RV
 
Thanks.

Well I thought I was being smart breaking the data into three tables. Maybe not.

One table is for the Club members. The second table are additional family members of the club members and the third table are the dogs of the club members. They all are linked by relationship to the clubmember in table one. Should I have set my dog club database up differently. Welcome to suggestions.
 
If this is the only piece of information that really is 'uniform' for all three tables, then they're alright in separate areas. Better three tables that are full than one huge table where 2/3 of the time, 2/3 of the fields are empty because you're not collecting the same data for all three types.

You _might_ consider making a sort of "Entity" table, with a [Role] field which could be club member, family member, or pet. Then go from there, and have associated subtables for the role-specific data. Or not.

You might find this topic interesting: http://www.access-programmers.co.uk/ubb/Forum4/HTML/006106.html

HTH,
David R
 
Thanks David R. I am a little confused but will try to process your post over the weekend. Thanks for your time.
 
Please post back to this thread if you have any further questions, or start another if your question changes significantly. There are lots of people here who like nothing better than helping others (as a side benefit, I get to learn a lot in the process, as well).

Good luck,
David R
 

Users who are viewing this thread

Back
Top Bottom