If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Outer Join more than two tables in MS Query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-17-11, 16:10
KimCruise KimCruise is offline
Registered User
 
Join Date: May 2011
Posts: 1
Question Outer Join more than two tables in MS Query

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...

Last edited by KimCruise; 05-18-11 at 10:44.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On