Divide by Zero Error

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!
 
G

Guest

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....
 
J

Jeff Boyce

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
 

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