AnsweredAssumed Answered

Keeping balance updated

Question asked by larsheise on Dec 8, 2011
Latest reply on Dec 9, 2011 by Mike_Mitchell

I really hope to get a hint, that could optimise my solution.

 

I have 2 tables. One for entering posts and the other with all the registered posts/records.

 

a post looks somehow like this:

date account text amount

 

When the user has entered all the posts my script takes one after one and puts them into the other table. My problem is to find an effective way to update the balance for each account.

 

Today I do like this

I go to all the related records ( same account no.)

Make a new record and register the record via variables

Then I sort by the date and goes to the last record

Then I loop back until I get to my recent post - ( balance is empty)

go one further back to get the balance of that record

and then I can loop back and update the records

 

( the other way I have tried is to sort by date and do a replace with a summary running total)

 

I find both my methods too slow with lots of records over Lan - not to mention wan.

 

There must be a more effective solution to this ??

 

 

Thanks

Lars

Outcomes