cj92713696
Programmer
I'm trying to write an ANSI SQL statement to pull data from three tables in both Access & SQL Server. I'd like to create one ANSI SQL statement and use it both in Access and SQL Server 2000.
My three tables are Inventory, GLACNT, and APVEND. I want all data from my Inventory table w/outer joins on GLACNT and APVEND. The data in those two tables may or may not be present. I've illustrated a simple example below w/o any luck. Do I have the syntax wrong for OUTER JOINs? Is there another way to do the below? Also, this may not even ANSI SQL. Any help is appreciated!
SELECT Inventory.ItemCode, GLACNT.Desc, APVEND.Desc
FROM Inventory
LEFT OUTER JOIN GLACNT ON Inventory.StoreCode = GLACNT.StoreCode AND Inventory.AcctNo = GLACNT.AcctNo
LEFT OUTER JOIN APVEND ON Inventory.StoreCode =
APVEND.StoreCode AND Inventory.VendorCode = APVEND.VendorCode
WHERE Inventory.StoreCode = "ABC";
Thanks,
CJ
My three tables are Inventory, GLACNT, and APVEND. I want all data from my Inventory table w/outer joins on GLACNT and APVEND. The data in those two tables may or may not be present. I've illustrated a simple example below w/o any luck. Do I have the syntax wrong for OUTER JOINs? Is there another way to do the below? Also, this may not even ANSI SQL. Any help is appreciated!
SELECT Inventory.ItemCode, GLACNT.Desc, APVEND.Desc
FROM Inventory
LEFT OUTER JOIN GLACNT ON Inventory.StoreCode = GLACNT.StoreCode AND Inventory.AcctNo = GLACNT.AcctNo
LEFT OUTER JOIN APVEND ON Inventory.StoreCode =
APVEND.StoreCode AND Inventory.VendorCode = APVEND.VendorCode
WHERE Inventory.StoreCode = "ABC";
Thanks,
CJ