Nz function in Report

depawl

Registered User.
Local time
Today, 06:09
Joined
May 19, 2007
Messages
144
I'm trying to use the Nz function in a report to return in zero when a null value is encountered, like so, where I have a field in a tex box named SumofChildPhone:
=Nz(SumofChildPhone,0)
but it retruns an error. I have tried various combinations using brackets and qotations, but no luck. I have read elsewhere that this should be possible to do.
I must be doing something wrong?
 
You can't use NZ on the sum, you have to use it on the original field that contains the null, so if you have a query that is summing records, you need to use it there.
 
Thanks Bob,
That's what i was afraid of.
would've been much simpler to do it in the report.
 
Bob:
When I set up the fields in the Query with the Nz function, then bring them into the report I can't sum them. For instance 5 + 1 sums to 51, rather than
6. I've tried changing all the fields to numeric but it didn't seem to make a difference.
 
It's about a 4 meg file. Is it possible to attach that large of a file to a post in this forum?
The problem I'm experiencing in the report is that previously, the sums of all the rows and columns worked correctly. Once I applied the Nz function to some fields in the query, the sums on the report no longer work correctly. Previoulsy summing 2 fields,
5 + 1 = 6
now
5 + 1 = 51
 
Have you tried

SumofChildPhone:CLng(Nz(SumofChildPhone,0))
 
Bob:
Sorry I didn't get back sooner. I was able to get it to work properly by summing the fields in the query. Thanks a bunch for all your help.
 

Users who are viewing this thread

Back
Top Bottom