D
DKS
Hi,
How can I write a piece of code that goes through some selected records from
my table and updates few fields.
Let us say that I have the following fields in a record
* transaction date
* starting balance
* transaction amount (can be positive or negative)
* new balance = starting amount + transaction amount
For the next chronological transaction date the starting balance is
identical to the new balance for the previous transaction date. Assume no
duplicates in transaction date.
With the above "architecture" of my table, I would like to implement some
logic whereby if I change the "transaction amount" for a given transaction
date, then automatically the new balance is correctly calculated for that
transaction. Thereafter the next transaction date record is automatically
updated for the starting balance. And because starting balance influences
the new balance this change is made. And since new balance is changed, the
next transaction date record has a new value for the starting balance. And
so on the ripple effect continues till we reach the end of the records-set.
How can I program this?
How can I write a piece of code that goes through some selected records from
my table and updates few fields.
Let us say that I have the following fields in a record
* transaction date
* starting balance
* transaction amount (can be positive or negative)
* new balance = starting amount + transaction amount
For the next chronological transaction date the starting balance is
identical to the new balance for the previous transaction date. Assume no
duplicates in transaction date.
With the above "architecture" of my table, I would like to implement some
logic whereby if I change the "transaction amount" for a given transaction
date, then automatically the new balance is correctly calculated for that
transaction. Thereafter the next transaction date record is automatically
updated for the starting balance. And because starting balance influences
the new balance this change is made. And since new balance is changed, the
next transaction date record has a new value for the starting balance. And
so on the ripple effect continues till we reach the end of the records-set.
How can I program this?