Search code examples
databasems-accesssdlc

How to fix this Syntax error in query expression?


I am working on Standard Access. I wrote this code:

SELECT *
FROM room
WHERE price < 40 AND
type IN ('Double", "Single")
ORDER BY price;

when I run it, it's telling me this message

Syntax error in string in query expression price < 40 AND type IN ('Double", "Single") ORDER BY price;


Solution

  • String literals in SQL are denoted by single quotes, not double quotes:

    SELECT * FROM room WHERE price < 40 AND type IN ('Double', 'Single') ORDER BY price