Skip to content
Advertisement

Operator Error with SWITCH Function in Access

I have been trying to execute the below SWITCH function in MS Access but I keep receiving the following error:

Syntax error (missing operator) in query expression.

I have used this before and it worked fine, but I have since received an error.

Advertisement

Answer

As explained by Olivier, the syntax error arises because the second comparison operator is missing the field on the left-hand side of the comparison:

However, note that only one comparison is actually required and therefore the code could be reduced to the following:

Since, if netsales is less than 1000, the first test expression will always be validated before the second, and so on.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement