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".
 
Just a thought, but if your 69 represents a % then perhaps your condition
should be

IIf([AttendanceRate]<0.69 And [Result]="Passed";"Qualified";"Pending")

--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 
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.)
 
Yes, it worked.

It was a matter of percentage.

Thank you all for the help.
 
I nominate Daniel Pineault for "Clairvoyancy of the Month Award". :-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top