Colin@Toyota
What's an Access?
- Local time
- Today, 17:38
- Joined
- May 2, 2006
- Messages
- 203
I am just wondering the proper procedure for nesting JOIN statements... I have a statement that is set up like this:
I need to add another join, but it is three tables away...
Something along the lines of... (I would add this to the above SQL)
I'm sure this is really quite vague, but if anyone can help I'd appreciate it! Also, bear in mind I am working with existing queries from the last person who took care of this db... and everything is so inter-connected, I can't really go too far towards changing as much as I'd like... I simply don't have the time.
Cheers,
Colin
EDIT: I tried running this, and it didn't like the syntax in my FROM clause, and highlighted the ON between table6 and table3
Code:
FROM (((table1
LEFT JOIN (table2
LEFT JOIN table3 ON table2.fieldA = table3.fieldA)
ON table1.fieldB = table2.fieldB
LEFT JOIN table4 ON table2.fieldC = table4.fieldC)
LEFT JOIN table5 ON table1.fieldD = table5.fieldD)
I need to add another join, but it is three tables away...
Something along the lines of... (I would add this to the above SQL)
Code:
INNER JOIN (table2
INNER JOIN (table3
INNER JOIN table6 ON table3.fieldX = table6.fieldX)
ON table2.fieldA = table3.fieldA)
ON table1.fieldB = table2.fieldB
I'm sure this is really quite vague, but if anyone can help I'd appreciate it! Also, bear in mind I am working with existing queries from the last person who took care of this db... and everything is so inter-connected, I can't really go too far towards changing as much as I'd like... I simply don't have the time.
Cheers,
Colin
EDIT: I tried running this, and it didn't like the syntax in my FROM clause, and highlighted the ON between table6 and table3