Convert nulls to zero in report

D

Dave

I want to convert a NULL field to zero in my report.

The report's record source is a query that uses an aggregate (e.g., SELECT
part, SUM(Amount)...).

When I set the control source of the textbox in the report to [Amount}, it
displays fine but will be balnk if Amount is null.

However, if I set the control source to this:

IIf(IsNull([amount])," ",[amount])

I get #error. I also get #error if I set it to =Amount.

How do I replace the Nulls with zero? And why can't I use an expression in
my control source?
 
D

Douglas J. Steele

" " is not the same as 0. Use IIf(IsNull([amount]), 0,[amount]), or
Nz([amount], 0)
 

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