IIf question

R

RobertM

I want my IIf statement to put in N/A if the value is either less than 0 or
greater than 0. I want it to put in the VarWComm value only if the value is
equal to 0. Here's my IIf below. Please tell me how to do this.

AmtOfLoss:
IIf([QryClassActRpt.VarWComm]<0,Format([QryClassActRpt.VarWComm],"Currency"),"N/A")

Thank you,

Robert
 
J

John Vinson

I want my IIf statement to put in N/A if the value is either less than 0 or
greater than 0. I want it to put in the VarWComm value only if the value is
equal to 0. Here's my IIf below. Please tell me how to do this.

AmtOfLoss:
IIf([QryClassActRpt.VarWComm]<0,Format([QryClassActRpt.VarWComm],"Currency"),"N/A")

Thank you,

Robert

Put <> 0 instead of <0. What do you want to see if VarWComm is NULL?

John W. Vinson[MVP]
 
M

Marshall Barton

RobertM said:
I want my IIf statement to put in N/A if the value is either less than 0 or
greater than 0. I want it to put in the VarWComm value only if the value is
equal to 0. Here's my IIf below. Please tell me how to do this.

AmtOfLoss:
IIf([QryClassActRpt.VarWComm]<0,Format([QryClassActRpt.VarWComm],"Currency"),"N/A")


You have the [ ] around too much and the < should be =

IIf([QryClassActRpt].[VarWComm]=0,Format([QryClassActRpt.VarWComm],"Currency"),"N/A")
 
Top