table joins

S

subs

in access joins - i have atable which has 2009 data and another table
that has 2008 data. when i combine these tables, i need to do a join
which can give me both 2008 and 2009 data.
in one of the joins i get that data which is available in both tables
in another join, i get that the data that is available in 2008 data
but not in 2009
in another join i get the data that is in 2009 but not in 2008

is there any way by sql query or something where i can combine all the
three scenarios above

for ex

table A

carrier price year
op 3333 2009
ot 233 2009


table B

Carrier price year
op 1200 2008
op1 1400 2008


i need a query which can give me the following data( by combining the
tables)-

Carrier price for 2009 price for 2008
op 3333 1200
ot 233 -
op1 - 1400


Thanks for the help
 
M

MGFoster

subs said:
in access joins - i have atable which has 2009 data and another table
that has 2008 data. when i combine these tables, i need to do a join
which can give me both 2008 and 2009 data.
in one of the joins i get that data which is available in both tables
in another join, i get that the data that is available in 2008 data
but not in 2009
in another join i get the data that is in 2009 but not in 2008

is there any way by sql query or something where i can combine all the
three scenarios above

for ex

table A

carrier price year
op 3333 2009
ot 233 2009


table B

Carrier price year
op 1200 2008
op1 1400 2008


i need a query which can give me the following data( by combining the
tables)-

Carrier price for 2009 price for 2008
op 3333 1200
ot 233 -
op1 - 1400

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

A UNION query:

SELECT Carrier, Price, [Year]
FROM tableA
UNION ALL
SELECT Carrier, Price, [Year]
FROM tableB

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

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

iQA/AwUBSfAwX4echKqOuFEgEQKq2ACg4MpIk2eVpD51O5TgMlwVlMeFjpsAoIM2
UzC2xj1BNiQyFJVoRZi05HlQ
=dZbj
-----END PGP SIGNATURE-----
 
K

KARL DEWEY

Why do you have separate table for each year? That is BAD.
Use MGFoster union query to put into single table.

To get the output you asked for use MGFoster union query to feed a crosstab
query.
 

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

Similar Threads

access joins 1
JOins pls help 4
sql queries 3
phone 1
Join queryies- urgent 1
joins pls help 1
SQL query urgent pls help 2
Consolidation Table from Different Excel Tabs with Different Format 1

Top