Access Query causes "Overflow" error

  • Thread starter Thread starter Ed Hawley
  • Start date Start date
E

Ed Hawley

Need help!

I have designed a simple query to add numbers in six colums then in the
forth column, I have an expression that adds them all up then divides them
by 6 to get their average. When I attempt to run the query, I get the
overflow error. I assume that I am carrying too many decimal places but do
not know how to limit them. Using the decimal limit on the query only limits
the number of places displayed not whats in memory. I could use some help!
Thanks! in advance - Ed
 
Hi,


You probably divide by 0 (or by a magnitude close to zero).


iif( f6 =0, Null, (f1+f2+f3+f4+f5) / f6 )

would work, in Jet. In VBA, you have to be more careful:


iif( f6 =0, Null, (f1+f2+f3+f4+f5) / iif(f6=0, 1, f6 ))



That changes the division by zero to a NULL (as in "not applicable" ).


Hoping it may help,
Vanderghast, Access MVP
 
Thanks Michel, I will try what you suggested. I also found a couple of other
errors to correct that may also take care of the problem. I need to stop
programming when I am tired.

Have a great day and thanks again.

Ed
 
Back
Top