OK this one is really making my head hurt and I would really appreciate some clarity of thought from you guys please.....
This is the table in question
Transactions
TransactionID
TransactionDate
DescriptionID
TransactionAmount
RollingBalance
Void
Now my huge brain aching problem is how and when to calculate the rolling balance field.
The data can be viewed such:
All void and non void
All non void only
All void and non void by date range
All non void by date range
Example say I have 4 transactions like this with rolling balance and all non void
27/05/2007 £10 £10
28/05/2007 £10 £20
29/05/2007 £10 £30
30/05/2007 £10 £40
Now the user voids 29/05/2007 and chooses to view non void only
27/05/2007 £10 £10
28/05/2007 £10 £20
30/05/2007 £10 £30
Now the user chooses to view them all void and non void where the voids appear in blue
27/05/2007 £10 £10
28/05/2007 £10 £20
29/05/2007 £10 £30
30/05/2007 £10 £40
Now Im getting completly brain drained as to at what point do I calculate the rolling balance?
The calaculation needs to know what was the previous rolling balance entry so do I have to recalc the entire table each time the user adds a transaction?
If the dataset table holds only a subset say Jan - Feb and the user adds a transaction for Aug the program would need to reload the table with all records to get the last rolling balance value, is this cpu hungry bad programming?
(mmm what if the program always load the enire table ... but the bindingsource filters to the dates the user selects? Could I still access the entire table for calculation purposes?)
Could/Sould I always store the last rolling balance in a seperate lookup table?
Or....now talking out loud ... should I even be considering this voiding issue?
My thoughts are that I am trying to replicate a bank statement, and importing from my online banking. But if I make an error entering a transaction I wanted to be able to void it to then choose to omit from the display.
It would also allow me to void a whole block of trnasactions in a date range for say archiving purposes.
Have I lost the plot completly in my database design/functionality making it overly complicated for no good reason.
Some sane clear thoughts would be most welcome.
Thanks
This is the table in question
Transactions
TransactionID
TransactionDate
DescriptionID
TransactionAmount
RollingBalance
Void
Now my huge brain aching problem is how and when to calculate the rolling balance field.
The data can be viewed such:
All void and non void
All non void only
All void and non void by date range
All non void by date range
Example say I have 4 transactions like this with rolling balance and all non void
27/05/2007 £10 £10
28/05/2007 £10 £20
29/05/2007 £10 £30
30/05/2007 £10 £40
Now the user voids 29/05/2007 and chooses to view non void only
27/05/2007 £10 £10
28/05/2007 £10 £20
30/05/2007 £10 £30
Now the user chooses to view them all void and non void where the voids appear in blue
27/05/2007 £10 £10
28/05/2007 £10 £20
29/05/2007 £10 £30
30/05/2007 £10 £40
Now Im getting completly brain drained as to at what point do I calculate the rolling balance?
The calaculation needs to know what was the previous rolling balance entry so do I have to recalc the entire table each time the user adds a transaction?
If the dataset table holds only a subset say Jan - Feb and the user adds a transaction for Aug the program would need to reload the table with all records to get the last rolling balance value, is this cpu hungry bad programming?
(mmm what if the program always load the enire table ... but the bindingsource filters to the dates the user selects? Could I still access the entire table for calculation purposes?)
Could/Sould I always store the last rolling balance in a seperate lookup table?
Or....now talking out loud ... should I even be considering this voiding issue?
My thoughts are that I am trying to replicate a bank statement, and importing from my online banking. But if I make an error entering a transaction I wanted to be able to void it to then choose to omit from the display.
It would also allow me to void a whole block of trnasactions in a date range for say archiving purposes.
Have I lost the plot completly in my database design/functionality making it overly complicated for no good reason.
Some sane clear thoughts would be most welcome.
Thanks