Result from a IIf statement

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

Guest

Don't know if this is possible but I was hoping some can help.

I have a IIf statement who's expersion is -([A]/>[C],[D],0) with A, B, C
and D being fields from a query, what I want to do is have a '0' returned in
the field if the result of [A]/ is 0 at the moment I get an #Error, which
is of course the correct result but this dosen't look good on a report

Many Thanks for your time and Patentice
 
Souchie,

If the result of [A]/ is 0, I can't see why you would get #Error.
And the only reason you would need to change the expression is if [C]
can ever be a negative value... can it?

You will probably get #Error if =0. Is this the situation you are
referring to? If so, maybe like this might be easiest...
IIf(=0 Or [A]/<=[C],0,[D])
 
Steve,

Many thanks and your right B can = 0 and the expression works great

Steve Schapel said:
Souchie,

If the result of [A]/ is 0, I can't see why you would get #Error.
And the only reason you would need to change the expression is if [C]
can ever be a negative value... can it?

You will probably get #Error if =0. Is this the situation you are
referring to? If so, maybe like this might be easiest...
IIf(=0 Or [A]/<=[C],0,[D])

--
Steve Schapel, Microsoft Access MVP
Don't know if this is possible but I was hoping some can help.

I have a IIf statement who's expersion is -([A]/>[C],[D],0) with A, B, C
and D being fields from a query, what I want to do is have a '0' returned in
the field if the result of [A]/ is 0 at the moment I get an #Error, which
is of course the correct result but this dosen't look good on a report

Many Thanks for your time and Patentice

 

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


Back
Top