credit an account

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I don´t know, if it is possible, but maybe you can help me. Expect you have
an account in some financial institution. You put there some of your money
which yields the interest each day. For example. You put there 1000 USD on 1.
January 2007. This over night deposit yields 2% p.a. Next day (on 2.January
2007) you will have on your account the amount equal
1000+1000*0,02/360*1=1000,056
The number 1 represent the number of days (2.January-1.January = 1 day).
Now, consider that on 2.January you put there some extra money let´s say
1200 USD. The rate valid for the date from 2.January to 3.January is 3%. To
find out the balance of your account as of 3.January, you have to consider
your money from your past. So, the balance of account is following:
(1000,056+1200)+ (1000,056+1200)*0,03/360*1=2200,239
Again, number 1 represent the number of days (3.January-2.January).And the
new interest yield is count from your actual deposit (1200 USD) and your last
deposit (1000 USD plus the interest).


The next table may help.


Date CAfTD fromCAfTD to Rate Credit of account Investment
1 .1 .2007 1.1.2007 2.1.2007 2 0 1000
2 .1 .2007 2.1.2007 3.1.2007 3 1000,055 1200
3 .1 .2007 0 2200,238 0

Where CAfTD from is the date from
CAfTD to is the date to


And now the question. Is it possible to make system, by some type of
function, which ensure the continuity of this process? (like in the table).
I´ve just ask because I am able to create such output, but by using the very
complicated system of connected tables and querries. It´s most weakness is,
that is created by add querry and I cannot correct the data without deleting
the following. For example if I have time series from 1.1.2007 to 10.1.2007
and I find out, that I made mistake in 2.1.2007, I have to delete all values
after this day. I tried to create something more automated.

Thank you for your help.
 
Since your "add query" system seems to be working OK if there are no errors,
I would recommend that you build a "correct error" process that would update
your account balance table from the error date to present. This would
involve writing a generic function that would calculate new balance given
parameters of previousBalance, rate, duration; calling this function for each
date in the account balance table in order to update the balance.
 
Back
Top