[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.4

Using MS access, how to get the correct number of records to return when joining on two fields

Asked by moorecm in Microsoft Access Database

Tags: access, get, ms, number

Hi,

I'm having a problem with getting the right number of records to return when I do a left join.

My original table (133334_0215_WITHOUT_INV) HAS 59,919 records.  My second table (133334_0215_JUST_INV) has 40,728 records.

These 40,728 are based on an index of my original query.  I'm pulling a field called Invoice # that I cannot pull in the

original query.  So my second query is pulling just the fields I need to join on, in addition the field that I need -

(inv_num)  The fields I'm matching on are:  ccmc #, and date.

These two fields are what is common between the two tables.  Once I match on these two fields, I want all output fields

displayed (all fields from table: 133334_0215_WITHOUT_INV, plus the field of INV_NUM from the table:  133334_0215_JUST_INV)

I know that my total number of records should always = 59,919 - it's just that of these 59,919 some will have an INV_NUM, and

some will not.  According to my second table, there should be 40,728 records with an invoice # out of the total # of 59,919.

I'm not sure what I'm doing wrong, but using access query wizard, I'm left joining on ccmc # and the date fields between the

two tables, and I do get records back - 45,716 with an INV_NUM, and 17,931 without an Inv_num - this = 63,647 which is more

that my original file of 59,919.

I'm not sure what is happening, but my final output should be only 59,919 records, of which 40,728 should have an INV_NUM.

Here is a sample of the data from table: 133334_0215_WITHOUT_INV

pat name                       dept       Loc            ccmc #      visit type      apt date      
GARUTI,JESSICA J       HEM      CCM            115920       FUV            8/25/2005      
GARUTI,JESSICA J       HEM      CCM            115920       FUV            10/13/2005
SULLIVAN,JACKIE       PRIM      CCM            115925       NEW            02/01/2005
MOORE,CATHERINE      ENDO      CCM            115325       FUV            06/20/2005

Here is a sample of that data from table:  133334_0215_JUST_INV

ccmc #                              dos                inv #
115920            08/25/2005      775001
115325            06/20/2005      775005

So the invoice #'s should be added to the names from above:  Garuti, Jessica for apt date 08/25/05
and for Moore,Catherine for apt date 06/20/05

The other two lines Garuti, Jessica for apt date 10/13/05 and Jackie Sullivan for apt date 02/01/05 should still be listed in my final output, but without invoice numbers.

Can you provide the correct sql, or help me to get the correct number of records back - 59,919 (some with invoice numbers, so without)

Please let me know if you need anything further from me....

Thanks,
Christine
[+][-]02/15/06 03:06 PM, ID: 15966172Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Microsoft Access Database
Tags: access, get, ms, number
Sign Up Now!
Solution Provided By: kirenievs
Participating Experts: 2
Solution Grade: A
 
[+][-]02/15/06 01:18 PM, ID: 15965007Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/15/06 01:40 PM, ID: 15965232Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/15/06 01:56 PM, ID: 15965411Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/15/06 02:00 PM, ID: 15965475Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/15/06 04:03 PM, ID: 15966573Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/15/06 11:32 PM, ID: 15968785Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]03/22/06 07:19 AM, ID: 16258170Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]03/26/06 02:40 PM, ID: 16296199Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93 - Hierarchy