IIF statement using 2 criteria

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
 
R

RonaldoOneNil

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))
 

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

Top