IIF Statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Here is my problem. I'm trying to build an IIF statement in a report. If I
build it in the query, it removes the entire record. So in the field on the
report, I want it to show the data if there is any, if the field is 0 or
null, I want it to be blank.

So so far here is what I have.

IIF(Field1),is null,"")

This appears to be only partially correct, because it does remove the field,
but does not show the data that is there.
Thanks for any info!!!!
 
Here is my problem. I'm trying to build an IIF statement in a report. If I
build it in the query, it removes the entire record. So in the field on the
report, I want it to show the data if there is any, if the field is 0 or
null, I want it to be blank.

So so far here is what I have.

IIF(Field1),is null,"")

This appears to be only partially correct, because it does remove the field,
but does not show the data that is there.
Thanks for any info!!!!

Use an unbound text control on the report:

=IIf(IsNull([Field1]) Or [Field1] = 0,"",[Field1])
 
Susan said:
Here is my problem. I'm trying to build an IIF statement in a report. If I
build it in the query, it removes the entire record. So in the field on the
report, I want it to show the data if there is any, if the field is 0 or
null, I want it to be blank.

So so far here is what I have.

IIF(Field1),is null,"")

This appears to be only partially correct, because it does remove the field,
but does not show the data that is there.


Try using:
=IIf(Nz(Field1,0) = 0, Null, Field1)

On the other hand, there is no need to do that. You can use
a custom format specification to get the same effect. Try
setting the text box's Format property to:

0.00;-0.00;"";""
 
Back
Top