Solved

Find Records in Access with a query

Posted on 2013-06-26
4
362 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 40

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 48

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
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…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

752 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