IIF statement using 2 criteria

  • Thread starter Thread starter Carla
  • Start date Start date
C

Carla

I have an attendance database in access 2007
I am assigning points based on absence
I have a field called classattending which returns a value of class 1, class
2, or class 3

the classes are of varying lengths so if a student is absent, they get
points based on the class they attend. For example, if you attend class1 and
are absent you get 3 points, if you attend class2 or class3 and you are
absent you get 2 points

I need an iif statement that satisfies both conditions and then asigns points
IIF([classattending="class1"and [inclass]="absent",3 otherwise, in
classattending="class2 or class3, and [inclass]="absent,2)

can you guide me in the right directoin

Thanks
 
The following will assign 0 if none of the conditions are met

IIF([classattending]="class1" And
[inclass]="absent",3,IIF(([classattending]="class2" Or
[classattending]="class3") And [inclass]="absent",2,0))
 
Back
Top