quickbooksdev — 2010-12-20T09:32:35-05:00 — #1
How do you do multiple joins to the same table?
Given an Address table that has both Billing and Shipping Addresses (2 records) for the same customer.
Trying the below but I get Join Expression not supported
FROM ( ( ( OrderDetail
INNER JOIN [Order] ON OrderDetail.OrderNumber = [Order].[Order Number] )
INNER JOIN Customer ON Customer.ID = [Order].BIllingId)
INNER JOIN Customer ON Customer.ID = [Order].ShippingId)
r937 — 2010-12-20T09:48:32-05:00 — #2
with table aliases
FROM ( (
ON [Order].[Order Number] = OrderDetail.OrderNumber
JOIN Customer AS b_cust
ON b_cust.ID = [Order].BIllingId
JOIN Customer AS s_cust
ON s_cust.ID = [Order].ShippingId
quickbooksdev — 2010-12-20T14:18:01-05:00 — #3
Thanks that worked but it took a while to see where the parenthesis go.
I kept the death star for the time being:x
r937 — 2010-12-20T14:33:05-05:00 — #4
quickbooksdev — 2010-12-21T06:08:33-05:00 — #5
Yes, I added the parentheses as in your example and it worked. Thanks!!!:)
I had some confusion about the number of parentheses (why 2 when there were 3 joins, etc).