Hi guys, I'm trying to use the following iif statement in a query and it doesn't seem to be working.
"Charge" is a field in one of my tables (also used in the query)
"Rate" is also a field in on the of the tables.
"Sales" however is a calculated field in the query (E.g. "Sales: (calculations)
Maybe this is where I am going wrong? However, even with the 'Charge' field set to "NO" it will display the result "0".
Thanks for any help.
You didn’t say exactly what was going wrong with your column returned using the IIf statement, but let me tell you what the statement as written is actually doing and maybe you can take it from there.
The IIf statement has three parts, expression to evaluate, value returned if true, and value returned if false. The value returned If true is a text zero and the value returned if false is a number, numeric format. Maybe the difference in format returned for whether or not charge=”no” is at the root of your problem. Think about it.