Solved IIF statement with 3 conditions (1 Viewer)

Ashfaque

Student
Local time
Today, 19:00
Joined
Sep 6, 2004
Messages
766
Hi,
I am trying to deal with 3 Conditions using IIF condition.

Fields that I have CAccomByCo (Check) and CAccomAllw (Integer)

Conditions :
1. If CAccomByCo unchecked And CAccomAllw = 0 Then The Result in Text191 should be 0
2. If CAccomByCo unchecked And CAccomAllw > 0 Then The Result in Text191 should be CAccomAllw
3. If CAccomByCo checked And CAccomAllw = 0 Then The Result in Text191 should be "By Company"

But my code is producing nothing although it has no error.

Code:
=IIf(IsNull([CAccomByCo] And [CAccomAllw]=0),0,(IIf(IsNull([CAccomByCo] And [CAccomAllw]>0),[CAccomAllw]),"By Company"))

Can someone help me please....
 

isladogs

CID VIP
Local time
Today, 14:30
Joined
Jan 14, 2017
Messages
15,240
If CAccomByCo is a boolean value then your IIf condition should be true or false for that field.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:30
Joined
May 7, 2009
Messages
13,691
=Switch(CAccomAllw > 0, CAccomAllw, CAccomByCo, "By Company", True, 0)
 

Users who are viewing this thread

Top Bottom