I'm working in Microsoft Access.
I have two tables, Production and Reagents.
Reagents
- Reagent Reference ID (text)
- Supplier (text)
Production
- Production Reference ID (text)
- C Reference ID (text) (matches Reagents.Reagent Reference ID)
- P Reference ID (text) (matches Reagents.Reagent Reference ID)
I'm trying to build a query to link the Supplier of C and P (from Reagents) to the Production Reference ID (from Production), as below.
Query Output
- Production Reference ID
- C Supplier
- P Supplier
Below is what I've got so far, but it tells me I'm missing an operator.
SELECT C.Supplier as 'C Supplier', P.Supplier as 'P Supplier'
FROM Production
INNER JOIN Reagents AS C ON C.Reagent Reference ID=Production.C Reference ID
INNER JOIN Reagents AS P ON P.Reagent Reagent Reference ID=Production.P Reference ID
WHERE Production.Production Reference ID=?
Thanks in advance!