G
Guest
I have a database that tracks payments on loans going back over 10 years.
One table has loan information...another has payment information, by date.
A report exists that essentially starts with the beginning balance of the
loan...then lists each payment and creates a running total of the balance.
I want to add a component to this running total that calculates interest
due, by month, in the report.
To do this, I need to compare the date in each payment record to the date in
the record just previous.
What I am having trouble with is trying to figure out how to create a
'stored' value so that the report can compare the current date to the date on
the line above....or retrieve a value from the previous record...
The issue is that there are over thousands of payments in the db for many
loans. Often, months will go by with no activity so I need to compare the
balance at the last payment to the current payment and apply
interest....based on the number of days that were between the two records.
example:
Date Pmt Prev Date % Int
11/1/05 -100 9/15/05 .05 7.50
12/1/05 -100 11/1/05 .05 5.00
If you have any ideas...I would appreciate it.
One table has loan information...another has payment information, by date.
A report exists that essentially starts with the beginning balance of the
loan...then lists each payment and creates a running total of the balance.
I want to add a component to this running total that calculates interest
due, by month, in the report.
To do this, I need to compare the date in each payment record to the date in
the record just previous.
What I am having trouble with is trying to figure out how to create a
'stored' value so that the report can compare the current date to the date on
the line above....or retrieve a value from the previous record...
The issue is that there are over thousands of payments in the db for many
loans. Often, months will go by with no activity so I need to compare the
balance at the last payment to the current payment and apply
interest....based on the number of days that were between the two records.
example:
Date Pmt Prev Date % Int
11/1/05 -100 9/15/05 .05 7.50
12/1/05 -100 11/1/05 .05 5.00
If you have any ideas...I would appreciate it.