Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 JOIN more then 2 tables?

Author  Topic 

MikeB
Constraint Violating Yak Guru

387 Posts

Posted - 2002-08-20 : 10:44:18
Is it possible to join more then 2 tables?
If so, can someone help me out with how to do this?

I have the following tables

Table1:
ProjectID | ComponentID | ShippingDate | LoadNumber

Table2:
ComponentID | Length | Width | Weight

Table3:
ComponentID | Length | Width | Weight |.....|.....|.....|


Now I know what you are going to say. "Table2 and Table3 look the
same why not just make them one?". The two tables are entirely
different in the sence that they deal with totally different Component
types and are populated using 2 very different applications.
I am only trying to tie them together for the shipping component
of my applcation. They are, however, in the same database. The
trick is that one load can have both components on it.

Is there any way to do this?

Mike B



Edited by - MikeB on 08/20/2002 10:46:16

LarsG
Constraint Violating Yak Guru

284 Posts

Posted - 2002-08-20 : 11:11:18
select * from (table1 inner join table2 on table1.componentid = table2.componentID) inner join table3 on table2.componentid = table3.componentID

The use of parentheses is specific to Access. If you have more tables, just add parenteheses in the same manner. (There is some sort of query wizard in Access that can be used for this purpose. No personal experience, just hearsay.)

Go to Top of Page
   

- Advertisement -