Query and relationships

K

KUMACCESS

I have two tables. The first table (table1) has four colums A, B, C and D.
There are 10 records. In the second table (table2) there are 3 columns E, F &
G. There are four records in the second table.
I need a query, that would contain all the ten records from the first table
and add the data from column F of the second table, based on a relationship
(columns A from table 1and Column E from table2 are identical type of data).
Note that not all records of the second table has a value in column F.
When i create a query, i get more than 10 records. There is some
duplication. The actual data I am working has more than 5000 records making
it more difficult to idenitfy the problem. Any help is apprecitaed
 
R

Ryan

Create a query with both table1 and table2. Right click on the line that
shows the relationship. Select Join Type, and then select "Show all records
from table1 and only records from table2 that match". Add all columns from
table1 and only column F from table2.
 
K

KUMACCESS

Ryan,
Thanks for the info. I did try that and it shows more records intead of 10
records of table 1. That's where the problem is. Not sure, if I explained
well in the first instance.
 
R

Ryan

There is a wizard in access that will help you in identifing your duplicates.
Go to the queries, and then hit the new button at the top. One of the
wizards is a find duplicate query wizard. You will need to identify and
remove duplicates before you do anything else. Try out the wizard and let me
know if that helps.
 
P

pietlinden

Ryan,
Thanks for the info. I did try that and it shows more records intead of 10
records of table 1. That's where the problem is. Not sure, if I explained
well in the first instance.

If you create the query manually - add both tables to the grid and
join the two tables on the shared field. Then right-click the line
joining the tables and select the second or third option, depending on
which table has the records you want to keep. Sounds like you picked
the wrong table. Once you get that working, you can filter the second
table (the "outer" one - the one with the arrow pointing at it) by
dragging it to the grid and filtering. Where the join field (in Table
B) Is Null (or Is Not Null), depending on what you need.
 

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