0

The exact error message is:

ProgrammingError: ('42000', "[42000] [Microsoft][ODBC Microsoft Access Driver] Syntax error (comma) in query expression 'occupied = False, electric = False, family = False, disabled = False'. (-3100) (SQLExecDirectW)")

I've looked everywhere I can see but don't understand what I'm doing wrong, the line in question is as follows:

spacelist = cursor.execute("SELECT space, distance1, distance2, distance3, distance4, distance5 FROM spaces WHERE occupied = False, electric = True")
Parfait
108k19 gold badges103 silver badges138 bronze badges
asked May 11, 2022 at 13:05
2
  • 2
    Try: WHERE occupied = False AND electric = True Commented May 11, 2022 at 13:14
  • The WHERE clause is wrong Commented May 11, 2022 at 13:17

1 Answer 1

2

Try this :

spacelist = cursor.execute("SELECT space, distance1, distance2, distance3, 
distance4, distance5 FROM spaces WHERE occupied = False AND electric = True")
answered May 11, 2022 at 13:22
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.