Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I want to be able to merge data from three data tables from my underlying sql database. My code works when executed as a stand-alone statement fired directly at the db but in VB it falls down with an error dialog box showing no error number! The statement works fine when dealing with two tables but not the third! For the record here is the statement (spaced for clarity) :- SELECT Tickets.Account, Tickets.Qty, Tickets.Contract, Tickets.Currency_Code, Tickets.Exchange, Tickets.Futures_Date, Tickets.Premium, Tickets.Strike_Price, Tickets.Expiry_Date, Tickets.PC, Contracts.Lots_Size, InstrumentCodes.InstrumentCode FROM Tickets LEFT OUTER JOIN InstrumentCodes ON InstrumentCodes.Contract = Tickets.Contract AND InstrumentCodes.Exchange = Tickets.Exchange AND InstrumentCodes.Currency = Tickets.Currency_Code INNER JOIN Contracts ON Contracts.Short_Code = Tickets.Contract AND Contracts.Exchange = Tickets.Exchange AND Contracts.Currency_Code = Tickets.Currency_Code WHERE (Tickets.Account = '3MM') AND (Tickets.Contract = 'ZNHG') ORDER BY Tickets.Account, Tickets.Contract, Tickets.Currency_Code, Tickets.Exchange, Tickets.Futures_Date Any thoughts? Thanks. James. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
MS Query Joins | Excel Discussion (Misc queries) | |||
Excel query via ODBC, left joins on multiple tables | Excel Discussion (Misc queries) | |||
MS SQL Server Joins Concept | Excel Worksheet Functions | |||
Outer Joins | Excel Discussion (Misc queries) | |||
Columns in Full Outer Joins | Excel Programming |