Overflow error on calculate field in query - Help Please

F

FatMan

Hi all Access Gurus:
I am calculating field (actual a percentage based on the values of two other
fields in the query) and am getting an overflow error when I try to sort on
this field after the query has been displayed. If I do not try to sort on
this field after the query has been displayed my calculation displays the
percentage fine.

My calculation is:

Percent:([Good]-[Bad])/[Good]

In the table where [Good] and [Bad] come from they both have the data type
Number (field size double).

Can anyone please tell me how I can prevent the overflow error? I don't see
how the values I am working with could yield a number that is to large/small
for this field size. Should I change it to decimal?

Any help is greatly appreciated.

Thanks,
FatMan
 
D

Duane Hookom

I expect you have records with a Good value of 0.
Try:

Percent:IIf([Good]=0,0,([Good]-[Bad])/[Good])
 

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