access.query.overflow

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

Guest

I am trying to run a select query that sums a formula like a/b*c. i get an
overflow message. How do i avoid this message. "rounding" did not help.
 
Hi,

A couple of things can cause this, but both of them are similar in that the
result is exceeding the capacity of the data type. Probably the most common
cause is dividing by 0, which gives an infinite result that causes the
overflow error. The other cause is having calculations that return a result
beyond the capacity of the field size. In your case, if you are not dividing
by zero, it is possible that the field size is only integer, which can only
hold values up to 32,767. If you formula results in any values greater than,
or less than, the field size, you will get an overflow error.

When calculating fields in an Access query, Access (or Jet?) sets the field
type/size by looking at the formula. Often though, this field size is not
adequate. You can set the field output size and type by using the various
type conversion functions though. For instance, if you put your formula
inside of the CLng() function, the resulting field will be a long integer.
Similarly, if you use CDbl(), the output will be a double precision floating
point decimal field.

HTH, Ted Allen
 
thanks. it turns out i was dividing by zero in some cases. I took out the
zero fields. the other information is good to know!
 

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

Back
Top