Question on Iff Statement

J

John Lane

Using Access 2007, I have the expression "IIf(IsNull(Sum([Deposit
Amount])),0,Sum([Deposit Amount]))" in a query. All the data is null, but I
am not geting the "0" output. I don't se what I am doing wrong. The field
"Deposit Amount" is a Currency field. Thanks.
 
J

Jeff Boyce

John

"All the data is null" ... how do you know this?

If the field allows zero-length strings, they might be 'empty', but not
null.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
M

MGFoster

John said:
Using Access 2007, I have the expression "IIf(IsNull(Sum([Deposit
Amount])),0,Sum([Deposit Amount]))" in a query. All the data is null, but I
am not geting the "0" output. I don't se what I am doing wrong. The field
"Deposit Amount" is a Currency field. Thanks.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It should work. Have you tried the Nz() function:

Nz(SUM([Deposit Amount]),0)

It will return 0 if SUM() is NULL.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSbmYGoechKqOuFEgEQL1DwCfRzxA569mioFrCBjhMj9+K+pN5WMAnAt8
Wsw9T2rohYjYc/Pt0i0cCDJv
=cLSv
-----END PGP SIGNATURE-----
 

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