Query with two tables

L

Love Buzz

Hello all.

I am trying to create a report of customer account data using a fairly large
table (Table A). I also have a table that I manually enter customer account
information on (Table B). I want to use both tables in my query and identify
those accounts in Table A that I have information on in Table B. On the
report I am creating from this query, I want to reflect some type of
indicator that the account is on the 'special table', which is Table B.

Hope all of that made sense.

I don't even know where to begin.

Thanks for your help.
 
D

Danny Lesandrini

The first question is, how do you link these tables? What do they share in common?

Usually, it's a CustomerID or AccountNumber. If you don't have that, is the AccountName
unique, not duplicated anywhere in the main table?

Add both tables to a new query and drag this "Key" field from TableA to TableB.
Right-click the line that is created between these key fields and select the option
that returns ALL RECORDS FROM TABLEA. Now drag all the fields you want down
to the query and run it.
 
M

Marshall Barton

Love said:
I am trying to create a report of customer account data using a fairly large
table (Table A). I also have a table that I manually enter customer account
information on (Table B). I want to use both tables in my query and identify
those accounts in Table A that I have information on in Table B. On the
report I am creating from this query, I want to reflect some type of
indicator that the account is on the 'special table', which is Table B.


I think all you need to do is join the two tables using an
outer join. This can be done in the query designer by right
clicking on the line between the two tables and selecting
Join Properties. Then select the option for all records in
table A an any matching records in table B. Then you can
drag fields from table B to the query's field list.

With the query set up that way, records that have no
matching matching records from table B will have Null for
the table B fields.
 

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