Querie question

G

Guest

I have 3 tables one with dogs names, one with dogs breed names, and one with
the purchasers of the dogs. I need to make a query that shows the purchasers
last and first names, thier dogs names and thier dogs breed names. How do i
do this as a query.
 
M

MGFoster

Davko said:
I have 3 tables one with dogs names, one with dogs breed names, and one with
the purchasers of the dogs. I need to make a query that shows the purchasers
last and first names, thier dogs names and thier dogs breed names. How do i
do this as a query.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You don't show the columns in each table nor the relationship column(s)
between the tables, so this is a guess:

select p.last_name, p.first_name, d.[name], b.[name] as breed
from (purchasers as p inner join dogs as d
on p.purchaser_id = d.purchaser_id)
inner join breeds as b on b.breed_id = d.breed_id
order by p.last_name

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQjYhrYechKqOuFEgEQLUjgCfW6XN65S0gn97WpgrR5qNq8nam68AoMNi
6tSKT9Ag+7sEX293h/O47Vn4
=M2gw
-----END PGP SIGNATURE-----
 
J

John Vinson

I have 3 tables one with dogs names, one with dogs breed names, and one with
the purchasers of the dogs. I need to make a query that shows the purchasers
last and first names, thier dogs names and thier dogs breed names. How do i
do this as a query.

Your tables need to have some sort of joining fields which you don't
specify - i.e. your Dogs table needs a Breed or BreedID field as a
link to the Breeds table, and an OwnerID field to indicate who owns
the animal. If you have such fields, add all three tables to the Query
design window. Access should (if you've defined relationships between
the tables) it should automatically create join lines. You can then
select whichever fields you want to see.

If you don't have relationships, or don't have linking fields, then...
well, you need linking fields and you need relationships; you're using
a database, after all, and these are essential elements.

John W. Vinson[MVP]
 

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