Solved syntax error (comma) in query expression

dullster

Member
Local time
Today, 04:17
Joined
Mar 10, 2025
Messages
43
I'm trying to build an zoom expression in a query where if Basic Salary is >17100 to return an already calculated result, else 0.

This is my expression:
Federal tax: IIf([Basic Salary]>"17100.00",([tblEmployees]![Total of pay check]*[tblpayrolltaxes]![Percent of Withholding],0))

I'm getting a syntax error (comma) in query expression. Do you see anything that isn't right?
 
If the salary is numeric, remove the quotes from around the amount. I would also delete the inner ()s.
 
The syntax error is having the second, inner set of parenthesis, the logic error you will experience next is because you are treating [Basic Salary] as text.

As text "2" is greater than "100" because when text is compared it is done character by character. So the first character of "2" is larger than the first character of "100". If you want to compare numbers, don't use quotes. Also, [Basic Salary] should be a numeric field in the table. Is that correct?
 
I've also tried this and the results are "error".

Federal tax: IIf([Basic Salary]>"17100.00",[Recommended ded],0)
 

Users who are viewing this thread

Back
Top Bottom