I've set up access to use a 'linked table' so all tables etc are the same.
I've written this query which works just fine in SQL Server
Code:
SELECT Stoel.Stoelnummer, Rang, B.Stoelnummer
FROM Uitvoering
JOIN Stoel
ON Stoel.Zaal = Uitvoering.Zaal
LEFT JOIN(
SELECT Bezetting.Stoelnummer
FROM Uitvoering
JOIN Bezetting
ON Bezetting.Voorstellingsnummer = Uitvoering.Voorstellingsnummer
AND Bezetting.Uitvoeringsnummer = Uitvoering.Uitvoeringsnummer
AND Bezetting.Voorstellingsnummer = 1 AND Bezetting.Uitvoeringsnummer = 1
) AS B
ON B.Stoelnummer = Stoel.Stoelnummer
WHERE Uitvoering.Voorstellingsnummer = 1 AND Uitvoering.Uitvoeringsnummer = 1
Then I rewrote the query to access and ended up with the following:
Code:
SELECT dbo_Stoel.Stoelnummer, Rang, B.Stoelnummer
FROM dbo_Uitvoering
INNER JOIN dbo_Stoel
ON dbo_Stoel.Zaal = dbo_Uitvoering.Zaal
LEFT JOIN(
SELECT dbo_Bezetting.Stoelnummer
FROM dbo_Uitvoering
INNER JOIN dbo_Bezetting
ON dbo_Bezetting.Voorstellingsnummer = dbo_Uitvoering.Voorstellingsnummer
AND dbo_Bezetting.Uitvoeringsnummer = dbo_Uitvoering.Uitvoeringsnummer
AND dbo_Bezetting.Voorstellingsnummer = 1 AND dbo_Bezetting.Uitvoeringsnummer = 1
) AS B
WHERE dbo_Uitvoering.Voorstellingsnummer = 1 AND dbo_Uitvoering.Uitvoeringsnummer = 1
Which gives me a missing operator error (see attachment)
What's going wrong?