question about complex joins

Megatron-Lives

Board Regular
Joined
Jul 7, 2002
Messages
83
the join syntax for access is starting to irk me...

FROM table1
INNER JOIN
(table2 INNER JOIN
(table3 INNER JOIN
(table4)
ON table3.field1 = table4.field1)
ON table2.field1 = table3.field1)
ON table1.field1 = table2.field1

You are always linking the second to last table you joined to the last table you joined.

So, what happens when table1 is my main table, and tables 2, 3, and 4 are just lookup tables, so there is no shared field between tables 2 and 3 or between tables 3 and 4? The only shared fields are between tables 1 and 2, between tables 1 and 3, and between tables 1 and 4.

You can't repeat a table in the join, so how do you join multiple lookup tables to a single main table?

It's **** easy in SQL Server, you can join a field from any table in the join to a matching field in any other table in the join.

FROM table1
INNER JOIN table2
ON table1.field1 = table2.field1
INNER JOIN table3
ON table1.field1 = table3.field1
INNER JOIN table4
ON table1.field1 = table4.field1

I can't figure out how to do it in Access, though...
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
hmmm, apparently that basic syntax goes right out the window with more complex joins

I'm just gonna use the wizard a few times on various test db's until I learn the stupid nesting. What's up with the nesting anyway? Isn't access supposed to be an EASIER version of SQL Server? It shouldn't be twice as hard to write a query...

this is access 2000, btw
 
Upvote 0
ok, now i see where the "easy" comes in

i don't write my own queries anymore, i just let the wizard write it for me and then copy/paste it to my asp.
 
Upvote 0

Forum statistics

Threads
1,221,618
Messages
6,160,873
Members
451,674
Latest member
TJPsmt

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