Home > OS >  Syntax error in query expression, SQL via PYODBC
Syntax error in query expression, SQL via PYODBC

Time:05-12

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")

CodePudding user response:

Try this :

spacelist = cursor.execute("SELECT space, distance1, distance2, distance3, 
distance4, distance5 FROM spaces WHERE occupied = False AND electric = True")
  • Related