简体   繁体   中英

Syntax Error (missing operator) in query expresssion in MS Access

Access gives me a runtime error 3075 Syntax Error (missing operator). The SQL works in MS SQL Server 2012 but it doesn't work in Acces. Can someone help me?

Code:

CurrentDb.OpenRecordset("SELECT Gebruiker.[emailadres] FROM Voorwerp INNER
JOIN Bod ON Voorwerp.[Voorwerpnummer] = Bod.[Voorwerpnummer] INNER JOIN
[Gebruiker] ON Gebruiker.[GebruikersID] = Bod.[GebruikersID] WHERE Voorwerp.
[Voorwerpnummer] = 1")

Thank you in advance!

Carsten Flokstra

MS Access requires more parentheses for joins. Try this:

SELECT Gebruiker.[emailadres]
FROM (Voorwerp INNER JOIN
      Bod
      ON Voorwerp.[Voorwerpnummer] = Bod.[Voorwerpnummer]
     ) INNER JOIN
     [Gebruiker]
     ON Gebruiker.[GebruikersID] = Bod.[GebruikersID]
WHERE Voorwerp.[Voorwerpnummer] = 1;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM