Bevos
asked on
Changing output of IIf statement in SQL from -1,0 to a text value
Hello, I have the following nested IIf statement:
which works very well and gives me the value -1 for true and 0 for false. Instead of these values I would like to get the code INC for -1 and EXC for 0. Can anyone show me how to modify this statement to get this effect?
Thanks so much,
Bevo
New Reviewed Item: IIf(([PPopulation] And [DDesign1] And [O1Outcome1]),True,IIf(([PPopulation] And [DDesign1] And [D2Design2] And [O2Outcome2] And [SP_YN]),True,IIf(([PPopulation] And [DDesign1] And [D2Design2] And [O2Outcome2] And Not [SP_YN] And ([NTotal]>=100)),True,False)))
which works very well and gives me the value -1 for true and 0 for false. Instead of these values I would like to get the code INC for -1 and EXC for 0. Can anyone show me how to modify this statement to get this effect?
Thanks so much,
Bevo
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Capricorn, when I try that statement I get -1 still for true values and #Error when the value is 0. The SQL code is accepted by the program however without error.
ASKER
That worked sshah :) thanks so much both of you for your comments.
New Reviewed Item: IIf(([PPopulation] And [DDesign1] And [O1Outcome1]),True,IIf(([P