Subject Re: [ib-support] Help with procedure
Author Helen Borrie
At 10:09 PM 24/04/2003 +1000, I wrote:


>Daniel, yes it would, if the columns being SUMmed were themselves
>nullable. They are defined as
>TOTAL_PRICE T_MONEY_TYPE not null,
>TOTAL_COST T_MONEY_TYPE not null,
>
>so, summing them can't return null.
>
>h.


..which just gave me another idea why the calculations sometimes produce
wrong results...

The SP code is not re-intialising the variables with each pass of the
loop. So, if the loop passes through an invoice which has NO detail lines,
that invoice will get results that were calculated using the values of the
variables as they were when the loop previously DID return values, for a
different invoice header.

heLen