I have 3 tables in my MS query and I need to do an outer join one one them as I need all records in that table that meet my condition, but they don't all live in the one of the other 2 tables. In MS Query it doesn't allow an outer join on 3 or more tables... grrr...
So I've been reading some few forums and it does seem possible but you have to do it as straight SQL code and can't use the graphical representation... Which is fine... so I rewrote the SQL and did get results back... BUT I didn't get all the tables from the outer join -- I'm thinking something must be wrong with my syntax -- if anyone could help this would be FANTASTIC!!!
Here is the code:
SELECT sales.GCONTRACT
, invdine.invoice
, sales.status
, PAX.FNAME
, PAX.LNAME
, invdine.ship
, invdine.date
, invdine.dinecode
, invdine.seating
, invdine.tableid
, invdine.dateInvited
, invdine.invitedBy
, invdine.confirmed
, invdine.dateRequested
, invdine.Sharing
, invdine.Partysize
FROM PROD.dbo.invdine AS invdine
INNER
JOIN PROD.dbo.Pax AS Pax
ON Pax.INVOICE = invdine.INVOICE
LEFT OUTER
JOIN PROD.dbo.Sales AS Sales
ON Sales.INVOICE = invdine.invoice
WHERE sales.GCONTRACT='C166166'
My Tables are Sales, Pax, and Invdine
I need all records from Sales that have a GCONTRACT = C166166
Help...
