Solved

Find Records in Access with a query

Posted on 2013-06-26
4
356 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

707 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

13 Experts available now in Live!

Get 1:1 Help Now