Using "IF" and "OR" statements in a query... (1 Viewer)

Luke_Murphy

New member
Local time
Today, 16:30
Joined
Sep 22, 2004
Messages
9
Can this be done?

I want to say that if a field equals one of 4 criteria, so If(or(x=1,x=2,x=3,x=4), THEN perform a certain calculation ELSE perform another calculation. I've got the formula in Excel...

If(or(x=1,x=2,x=3,x=4),y+z,a+b)

...but I'm not sure how to get this to work in Access

Can anyone help?

Thanks in advance!
Luke
 

Mile-O

Back once again...
Local time
Today, 13:30
Joined
Dec 10, 2002
Messages
11,316
Code:
=IIf(X IN(1,2,3,4),Y+Z,A+B)
 

Luke_Murphy

New member
Local time
Today, 16:30
Joined
Sep 22, 2004
Messages
9
great, thanks.
 

monbois

New member
Local time
Today, 08:30
Joined
May 31, 2012
Messages
7
In the solution formula:

=IIf(X IN(1,2,3,4),Y+Z,A+B)

What comes between X and IN ?!?

Thanks.
 

Users who are viewing this thread

Top Bottom