Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-03-2016, 08:45 AM
wpflum wpflum is offline Help with data connection sql joins Windows 10 Help with data connection sql joins Office 2016
Novice
Help with data connection sql joins
 
Join Date: Aug 2016
Posts: 1
wpflum is on a distinguished road
Default Help with data connection sql joins

I'm trying to join three tables in an external odbc database and am having problems with joining them.



Here is the sql query I have as the data connection.

SELECT item.item_cd, item.item_desc, inv.inv_price_1, item_trsl.ittr_alt_cd, item.item_grp_nbr, item.item_sect_nbr, inv.loc_id

FROM informix.inv inv, informix.item item, informix.item_trsl item_trsl

WHERE inv.item_id = item.item_id AND item.item_cd = item_trsl.ittr_item_cd AND ((inv.loc_id=1)

The problem is that not every item_cd will have an ittr_alt_cd so what I need is a left join but I can't seem to do it.

Here is what i can do in Access for the same tables

SELECT informix_item.item_cd, informix_item.item_desc, informix_inv.inv_price_1, informix_item_trsl.ittr_alt_cd, informix_item.item_gl_nbr, informix_item.item_sect_nbr, informix_inv.loc_id

FROM (informix_item INNER JOIN informix_inv ON informix_item.item_id = informix_inv.item_id) LEFT JOIN informix_item_trsl ON informix_item.item_cd = informix_item_trsl.ittr_item_cd

WHERE (((informix_inv.loc_id)=1));


This works like expected but I can't seem to translate this sql query to the excel side. If I try to edit the query using the graphical interface i get "Can't have outer joins if there are more than two tables in the query' and if I try and modify the sql code itself I get things like 'Table (informix.inv) not selected in the query.

Help!
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Data connection from Excel to Sharepoint not working GraemeW Excel 0 01-16-2016 04:31 PM
Help with data connection sql joins Update data connection - path, database name, query definition jaworski_m Excel 1 08-03-2015 02:37 AM
Data Connection - auto logoff timshep Excel 0 08-02-2015 04:29 AM
Excel 2007 security alert - data connection message every time? michael.monaco Excel 0 12-20-2012 07:47 AM
Help with data connection sql joins joins gsrikanth Excel 5 04-14-2012 12:13 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:31 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft