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 and Inner Join with 3 tables in MSQuery (Excel 2003) linking to Sage 50

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-30-09, 09:47
wezzzles wezzzles is offline
Registered User
 
Join Date: Jun 2009
Posts: 1
Smile Outer Join and Inner Join with 3 tables in MSQuery (Excel 2003) linking to Sage 50

Hi Guys

My first post so please be kind?!

I am linking by ODBC to Sage Line 50 Data.

I don't have much experience with SQL and am having some trouble trying to link 3 tables. I have two tables joined via a LEFT OUTER and that works great. Now i would like to add another table into it, which is called "Project" it would be joined to the "Project_Tran" table by the PROJECT_ID filed/column in both tables (its the same variable in both). The whole reason i can't do this to start with of course, is that MS Query says that it will have to delete the outer join if i add another table. This is where i go into the SQL and mess around forever more and come up with nothing!

I have pasted the original code below before the extra table:

SELECT PROJECT_ONLY_TRAN.PROJECT_TRAN_ID, PROJECT_TRAN.PROJECT_ID, PROJECT_TRAN.DATE, PROJECT_ONLY_TRAN.QUANTITY, PROJECT_ONLY_TRAN.RATE, PROJECT_ONLY_TRAN.REFERENCE, PROJECT_ONLY_TRAN.DETAILS, PROJECT_TRAN.COST_CODE_ID
FROM {oj PROJECT_ONLY_TRAN PROJECT_ONLY_TRAN LEFT OUTER JOIN PROJECT_TRAN PROJECT_TRAN ON PROJECT_ONLY_TRAN.PROJECT_TRAN_ID = PROJECT_TRAN.PROJECT_TRAN_ID}

Then as stated above, i would like to join another table by Inner Join to "Project_Tran" by "Project_tran.Project_ID = Project.Project_ID". Once the link is complete i would like to show the "Description" column/field in the query.

here would be the SQL if it was just the extra one i was linking to the Project_tran tables:

SELECT PROJECT_TRAN.PROJECT_ID, PROJECT.DESCRIPTION
FROM PROJECT PROJECT, PROJECT_TRAN PROJECT_TRAN
WHERE PROJECT.PROJECT_ID = PROJECT_TRAN.PROJECT_ID


If there is anything else that would help you to help me, then please please let me know.

Thanks

Wes
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