Joint question

Anzek

New Member
Joined
Jan 20, 2016
Messages
17
Let say we have tables A, B, and C.
A left join B with key = invoice number ( A<---B).
B right join C with key = supplier code ( B---->C).

What does the result look like?

field1: A's invoice number
field2: some field from B that matches A's number and C's code?
field3: C's supplier code

But what about those records where no invoice number is found in B and/or no supplier code is found in B? Do they show up too? but with blank fields for invoice number and supplier code?

Thanks for reading my question!
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
But what about those records where no invoice number is found in B and/or no supplier code is found in B? Do they show up too? but with blank fields for invoice number and supplier code?
Yes. It appears the "B" here is your main controlling table (as you have the arrows starting from B and pointing to the other tables).
So, without any criteria, that would return ALL the records from Table B, and just the matches from Tables A and C. If there is no match in those tables, it will return a NULL value (which will look like a blank).
If you want to fill those NULL fields with some default value in the case where there is no match, you can use the NZ function.
See: https://www.techonthenet.com/access/functions/advanced/nz.php
 
Upvote 0
Sorry I'm an Access noob.
My arrows represent the real arrows in Access pointing from B to A and then B to C. I thought it means A left join B ( returning all from A and only those that match from B), and B right join C ( return all from C and only those that match from B). Is B still the controlling table?
 
Upvote 0
My arrows represent the real arrows in Access pointing from B to A and then B to C. I thought it means A left join B ( returning all from A and only those that match from B)
Nope. You have it backwards. If the arrow is pointing FROM B to A, then it is B Left Join A (returning all records from B and only those from A that match).

By the way, you actually do not need to remember this. Access will tell you.
If you open you query, and double-click on the Join line, Access will tell you exactly what it means.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top