IIF Statement

S

Susan

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!!!!
 
F

fredg

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])
 
M

Marshall Barton

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

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

Top