Divide by Zero Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a field in my query called "Cost per Pound". This is a calucated field
in which I divide the cost by the weight. I am now attempting to determine
the average cost per pound. When I simply view a listing of the cost per
pound, each record is populated. When I attempt to obtain an average,
however, I receive a "division by zero" error. I know that there are over
300,000 records, so it cannot be dividing by zero. Please help!
 
could be one of your Weight fields is blank (or has zero) or maybe an
entirely blank record has snuck into your table.

take a look at the table - no need to look at the records...simply do a
basic A-Z sort of the weight field...the blank record should immediately come
to the top....
 
You could use a selection criterion in your query to limit your output to
only those records where the [Weight] field is not null and is not zero and
is not a zero-length string.

That way, you'd never have a record with a zero-weight to be dividing by...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Back
Top