IIf (maybe) this, else leave blank

S

Stephanie

Hi. I can't remember how to say:

if [Abs] >0 then [Abs] else leave blank.

Thanks for the help!

Cheers,
Stephanie
 
S

Stephanie

Thanks for the tip. Here's what I went with:

=IIf([AGL]=0,"",[AGL])

Klatuu said:
First, Abs is not a name you should use. It is an Access reserved word. It
is the name of a function that removes the sign from a number.

=IIf([Abs] > 0, [Abs], Null)


--
Dave Hargis, Microsoft Access MVP


Stephanie said:
Hi. I can't remember how to say:

if [Abs] >0 then [Abs] else leave blank.

Thanks for the help!

Cheers,
Stephanie
 
D

Duane Hookom

I would go with Klatuu's use of Null rather than "". An IIf() should not be
allowed to return either a string or number. It should always return a single
data type or null. "" is a string and AGL is a number. IMHO, this is wrong.
--
Duane Hookom
Microsoft Access MVP


Stephanie said:
Thanks for the tip. Here's what I went with:

=IIf([AGL]=0,"",[AGL])

Klatuu said:
First, Abs is not a name you should use. It is an Access reserved word. It
is the name of a function that removes the sign from a number.

=IIf([Abs] > 0, [Abs], Null)


--
Dave Hargis, Microsoft Access MVP


Stephanie said:
Hi. I can't remember how to say:

if [Abs] >0 then [Abs] else leave blank.

Thanks for the help!

Cheers,
Stephanie
 

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