incorrect IIF condition

  • Thread starter Thread starter Amer
  • Start date Start date
A

Amer

Hi

I created a totals query to get the final status report of students based on
calculating attendance rate and test result.

I added the followinf condition using IIF:

Status: IIf([AttendanceRate]<69 And [Result]="Passed";"Qualified";"Pending")

So, the query should show "Qualified" if both arguments are true when the
attendance rate is greater than 69 and the result equals "Passed".

However, the query shows "Pending" only if the result does not equal "Passed".
 
The problem may have to do with how Access understands the data type of the
fields.

If you open your table in design view, what is the Data Type of the 2
fields? Is AttendanceRate a Number? And is Result a Text field?

If these fields don't exist in your table, what is the expression for them
in the query?

What do you have in the Total row in query design under AttendanceRate,
Result, and this Status field?

Try adding brackets:
Status: IIf(([AttendanceRate] < 69) And ([Result] = "Passed"),
"Qualified", "Pending")

If you are still stuck, switch the query to SQL View, and post the SQL
statement here as a follow up. Indicate if the query draws on other queries
(or only on tables.)
 
Back
Top