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

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

Similar Threads

making two IIf's work together 1
absolute value 2
Data mismatch problem 3
Nested Iif Formula Question 3
iif, or, else? 3
Building iif expression 2
IIf Statement Error 3
Help needed with IIF in my query 14

Top