I was doing a simple SQL with SUMs and got a numeric overflow error at random intervals. The code was:
SELECT sum(lineitem) as linetotal, sum(iif(taxable, lineitem, 0)) as taxtotal from MyTable into cursor MyCursor
The problem was the sum(iif(taxable, lineitem,0)) which worked about 95% of the time and gave me the numeric overflow error the remaining times. I presume I have to set the size of the numeric field, as must be done with variable length character fields, but don't know how.
All help gratefully accepted.
TIA
Barbara