>>Hi everybody,
>>
>>I have a loop, where some updates are done on Comision table in non-buffered mode.
>>
>>I recently changed my code to select sum(...) and I found a difference in my results. So, I switched back to sum ... Why would the results of these two commands differ?
>>
>>
>>SELECT SUM(rate*SHARE/10000) AS crate WHERE inv_no+salesman = m.ccinv + m.Slsman ;
>> FROM comision INTO ARRAY laArr
>>
>>SUM (rate*SHARE/10000) TO cRate WHILE inv_no+salesman = m.ccinv + m.Slsman
>>
>>
>>(I'm standing on the right record).
>>
>>Thanks in advance.
>
>Souldn't that scope be FOR? :
>
>SUM (rate*SHARE/10000) TO cRate
FOR inv_no+salesman = m.ccinv + m.Slsman
No, while will work since in the preceeding line of code (not shown here) I seek for m.ccinv + m.Slsman
I haven't figured why I was getting different results, but I decided to move on.
If it's not broken, fix it until it is.
My Blog