Pardon me, but the aggregate functions ignore nulls in the calculations.
So
I doubt that having null in a field will break the calculation of an
average.
Avg([Some Field]) should return a number or null if all the field values
that are being aggregated are null.
What type of field or value is [# of days in Custody]? Is it a field
from a
table or is it a calculation? If it is a calculated column in a query
has
it been formatted or does it use NZ in the query to ensure it returns a
value?
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
The Null value is cause the problem. You can use the Nz function to
prevent
this. When you use the Nz function, you must put each element of the
calculation that could possibly be null in a function, not the results
for
example, assume x = Null
Nz(x + 10, 0) will return 0
Nz(x, 0) + 10 will return 10
=Avg(Nz([# of days in Custody],0))
BTW, # of days in Custody breaks almost every naming rule there is.
Use only letters, numbers, and the underscore in names.
Do not use spaces or any special character other than the underscore.
Do not use any Access reserved words (Date, Value, Description, etc)
Typical database naming stanards dictate all upper case with words
separated
with the underscore, so a good name would be:
DAYS_IN_CUSTODY
--
Dave Hargis, Microsoft Access MVP
:
I'm using the expression below to figure out the Average Number of
days
in
custody from said field. I'm getting a 0 value in the report. Some
of
the
data has Null values depending on the case; is this why I'm getting
the
0?
Need all the help I can get.
=Avg([# of days in Custody])
Mr. Null & Void