IIf (maybe) this, else leave blank

  • Thread starter Thread starter Stephanie
  • Start date Start date
S

Stephanie

Hi. I can't remember how to say:

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

Thanks for the help!

Cheers,
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
 
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
 
Back
Top