Trying to use an IIf statement to join to fields

dbaker5204

Registered User.
Local time
Today, 10:40
Joined
Jan 19, 2018
Messages
20
I have two fields in a query that I would like to include in an IIF statement and I keep getting #Error. Here is what I have tried.

(The first field is a position ranking field and the second is an attendance field)

IIf([Position Ranking]=4 And [Attendance Rating]>=2,"2","1")

What is happening is, All the Position Fields that are a "4" and returning with #Error and all the Position Fields that are a "5" are returning with a 1 regardless of what the corresponding Attendance Rating is.

If more information is needed, just let me know!

Any help/suggestions are appreciated.
 
Is the ranking and rating text or a number?

If it's text then you'll need to enclose it in quotes, also you are returning a string not a number? To turn that around try;

Code:
IIf([Position Ranking]="4" And [Attendance Rating]>="2", 2 , 1)
 
Is this IIf statement in a calculated field in a query, or a control source of another field on a form? Also, what field type are the position and attendance fields? Text or number?
 

Users who are viewing this thread

Back
Top Bottom