Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Select SQL showing a syntax error (as below) while using "IIf" in the SQL. Whats the wrong?

"Syntax error (missing operator) in query expression 'IIf(opening < 0, opening As Receipt, 0 As Receipt)'."

opening is a numeric (double) field.

What I have tried:

"Select accode As SL, achead As Particulars, IIf(opening < 0, opening As Receipt, 0 As Receipt), IIf(opening > 0, opening As Payment, 0 As Payment) From accounts Order By achead"
Posted
Updated 4-Jun-20 16:47pm
v2

1 solution

I would try to replace
SQL
IIf(opening < 0, opening As Receipt, 0 As Receipt)

with
SQL
IIf(opening < 0, opening, 0) As Receipt
 
Share this answer
 
Comments
Maciej Los 5-Jun-20 2:02am    
5ed!
Patrice T 5-Jun-20 2:10am    
Thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900