Overflow error

T

Thrava

I'm running a query that gives an error message saying
overflow.

I narrowed down the problem to the fact that I am doing a
division and that the denominator of one of the fields may
be zero.

right now the formula in the query pane is: MarketShare:
[totalmarket]/[our_share]. The problem is that this query
gives market share calculations based on various
territories.... so if one of the territories has a zero
for the [our_share] field, it gives me this error.

How can I fix this so that if there is a zero, that it
would ignor and give me either a Null for that territory
or an "N/A"?

thanks
 
N

Norman Yuan

In the SELECT...statement, use

SELECT ...,IIF([our_share]=0,NULL,[totalmarket]/[our_share]) AS
MarketShare,..FROM tblXXXX WHERE...
 
T

thrava

Thank you. This worked like a charm. Much appreciated it.

-----Original Message-----
In the SELECT...statement, use

SELECT ...,IIF([our_share]=0,NULL,[totalmarket]/ [our_share]) AS
MarketShare,..FROM tblXXXX WHERE...

I'm running a query that gives an error message saying
overflow.

I narrowed down the problem to the fact that I am doing a
division and that the denominator of one of the fields may
be zero.

right now the formula in the query pane is: MarketShare:
[totalmarket]/[our_share]. The problem is that this query
gives market share calculations based on various
territories.... so if one of the territories has a zero
for the [our_share] field, it gives me this error.

How can I fix this so that if there is a zero, that it
would ignor and give me either a Null for that territory
or an "N/A"?

thanks


.
 

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

Similar Threads

Overflow Error 5
Access Overflow error 3
Numeric field Overflow 1
Numeric Overflow Error 4
Overflow Error Message 3
"Overflow" error on SELECT query 5
Overflow Error 1
Numeric Overflow error message 1

Top