[AccessD] IIf

Brett Barabash BBarabash at TappeConstruction.com
Thu Feb 26 09:26:09 CST 2004


Hi Bridget,
First of all, yes, IIf can be used in all types of queries.  However your
syntax is incorrect.

The best way to convert null values to zero is to use the built-in Nz
function:
=Nz([4])

Also, the proper way to check if a field is null is to use the IsNull()
function.  e.g. IsNull([4])
In a query you can also use the Is Null syntax e.g. [4] Is Null

HTH
Brett Barabash, MCP 
Tappe Construction, Co. 
Eagan, MN 
bbarabash at tappeconstruction.com 
(651) 256-6831 

"One thing a computer can do that most humans can't is be sealed up in a
cardboard box and sit in a warehouse."  -Jack Handey


-----Original Message-----
From: Bridget Doran [mailto:bridgetd at biostat.umn.edu]
Sent: Thursday, February 26, 2004 9:16 AM
To: accessd at databaseadvisors.com
Subject: [AccessD] IIf


Does anyone know if the Immediate If can be used with crosstab data? I'm
trying to report with this data and I've tried this: =IIf([4]=Null,0,[4])
on the report as well as in the query and I don't get any errors but I
also don't get what I want which is a zero in the case of no data.

Thanks - I'm using Access2K

-- Bridget Doran

Bridget Doran
Biostatistics Consulting Lab
University of Minnesota
A444 Mayo Building
612.626.7009
bridgetd at biostat.umn.edu


--------------------------------------------------------------------------------------------------------------------
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom
they are addressed.
If you have received this email in error please notify the
originator of the message. This footer also confirms that this
email message has been scanned for the presence of computer viruses.

Any views expressed in this message are those of the individual
sender, except where the sender specifies and with authority,
states them to be the views of Tappe Construction Co.

Scanning of this message and addition of this footer is performed
by SurfControl E-mail Filter software in conjunction with 
virus detection software.




More information about the AccessD mailing list