I have got 2 tables which are 'union' together to produce a set of records. This is fairly simple, here is the SQL
Code:
SELECT TOP 31 *
FROM
(
SELECT * FROM tblOrderItems
UNION ALL
SELECT * From tblDummy
)
Basically, this is to populate a report with 31 entries, regardless of how many real entries there are. Blank entries are present so that when printing a copy of the form, entries can be added my hand as well as the digital information
My issue is now when I want to pull information from other tables using INNER JOIN, it gives me the error 'Syntex error in JOIN operation'.
I'm new to SQL, so, naturally, I just copied the SQL from a MS Access created query and applied it into my previous code. Here is my problematic code
Code:
SELECT TOP 31 *
FROM
(
SELECT * FROM tblOrderItems INNER JOIN (tblOrderItems INNER JOIN tblOrders ON tblOrderItems.orderID = tblOrders.ID) ON tblSuppliers.supplierID = tblOrders.supplierID
UNION ALL
SELECT * From tblDummy
)
I expected this to pull the extra data in from the other table.
Any help would be greatly appreciated!