Solved

Find Records in Access with a query

Posted on 2013-06-26
4
358 Views
Last Modified: 2013-06-27
I created a new table with a query by Joining two tables and took some of the fields from one table and some from the other, but I know that not all the data matched by the joined filed so I did it so all the records from the first table were are created and only the ones from the second table. the main table has 10000 records and the joining table has 340 records. I expect the new table only to have 10,000 records however the new table has 34 more records.

I like assistance to find out what I am doing wrong and how do I find the extra 34 records on the new table???
0
Comment
Question by:TonyEF
4 Comments
 
LVL 48

Expert Comment

by:PortletPaul
ID: 39280223
>>so I did it so all the records from the first table were are created
how?
>>and only the ones from the second table
what does this mean?

please post all of the sql you used.
are you prepared to re-create this new table if needed?
when you copied to the new table did you include a unique ID from the first table?
0
 
LVL 39

Accepted Solution

by:
als315 earned 500 total points
ID: 39280289
You can have more records if in second table you have duplicate records.
For example:
First table:
ID
1
Second Table:
ID(FK)      SomeField
1            5
1            7

Your query with left join by ID and ID(FK) will give you 2 records.
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 39280806
What is probably happening is that you have duplicates in the second table which match the join field in the first table.

Check the 2nd table for duplicates, remove the duplicates, and your query should then return the 10,000 records you expect.
0
 

Author Closing Comment

by:TonyEF
ID: 39282572
thank you...
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now