No Value returning from query

B

Brennan

I have a query that sums a particular field as part of the query. Sometimes
there is not any data to sum and so no value is returned in the sum line. Is
there a way to return a zero (0) value in these instances? Thanks for your
help.

Brennan
 
J

Jerry Whittle

Check out the NZ function. In a query something like this:

Expr1: NZ([FieldName],0)
 
B

Brennan

Thanks Jerry for your quick response. I have tried using the Nz function
without success. Will that return a "0" value even if the normal query does
not return anything? I am trying to find this out, because sometimes there
is data that will return, but other times there is not. Thanks
 
J

John Spencer

Nz only works if there is a record returned. Nz works at the field level
not at the record level (when you are using it in a query).

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 

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