>>I think that, indeed, the best alternative is to re-calculate all data that affects the stock balance. And that is exactly what I do, in a similar system.
>>
>>Hilmar.
>
>Agree 100% with you Hilmar but he gotta have in mind the actual size of the table. A calculation like this could restraint the program execution if the table got too big.
I, again, agree 100% with this caveat.
Perhaps this could be solved by saving the current stock once a month or once a week, and then calculating backwards or forwards from that point. This would greatly reduce the amount of calculations required. Of course, it would initially be more work for the programmer.
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)