Query Same Information From Multiple Tables

D

dutch184

I have 3 tables, with basically the same fields, that I am trying create a
query:

a) Infant Table
b) Teen Table
c) Adult Table

All 3 tables have a Fname, Lname, Address and Zip Code field. I wish to
create a query that finds all those individuals who reside in one specific
Zip Code.

How is this done?

All Help suggestions deal with different fields from different tables and
are not specific to what I need.
 
G

Golfinray

Build a query pulling all three tables in and connect them. You may have to
find the right type of join. When you join, you might try joining on zip
code. You may have to right click on the line and change the join properties.
Then you can just put whatever zip you want in the criteria line.
 
K

KARL DEWEY

You should be using just one table with a field for AgeGP and enter Infant,
Teen, or Adult.
Use a union query to pull together --
SELECT Fname, Lname, Address, [Zip Code]
FROM Infant
UNION ALL SELECT Fname, Lname, Address, [Zip Code]
FROM Teen
UNION ALL SELECT Fname, Lname, Address, [Zip Code]
FROM Adult;
 
D

dutch184

Hey Thanks Karl:

Your suggestion looks like it will allow me to make additional queries on
other fields in my tables by just setting the parens on the field I'm looking
for.

Thanks


KARL DEWEY said:
You should be using just one table with a field for AgeGP and enter Infant,
Teen, or Adult.
Use a union query to pull together --
SELECT Fname, Lname, Address, [Zip Code]
FROM Infant
UNION ALL SELECT Fname, Lname, Address, [Zip Code]
FROM Teen
UNION ALL SELECT Fname, Lname, Address, [Zip Code]
FROM Adult;

--
KARL DEWEY
Build a little - Test a little


dutch184 said:
I have 3 tables, with basically the same fields, that I am trying create a
query:

a) Infant Table
b) Teen Table
c) Adult Table

All 3 tables have a Fname, Lname, Address and Zip Code field. I wish to
create a query that finds all those individuals who reside in one specific
Zip Code.

How is this done?

All Help suggestions deal with different fields from different tables and
are not specific to what I need.
 
J

John W. Vinson

Build a query pulling all three tables in and connect them. You may have to
find the right type of join. When you join, you might try joining on zip
code. You may have to right click on the line and change the join properties.
Then you can just put whatever zip you want in the criteria line.

Golfinray, that will NOT work as desired! Joining on Zip code would link every
adult in that mailing area, to every teen in that mailing area, to every
infant in that mailing area. You need to join on a field which provides a
*logical*, unique connection between the records.

A UNION query will be much more appropriate for the OP's problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top