Connecting Tech Pros Worldwide Help | Site Map

interest calculation

  #1  
Old November 13th, 2005, 02:33 AM
jmd
Guest
 
Posts: n/a
I need to write either a query or VB to calculate daily interest on a
simple savings account. I use the following formula(s) to calculate
the running balance for each transaction.

Transdate

Transaction

Bal: DSum("[transaction]*[transtype]","tblsavingstable","DatePart('m',
[transdate])<=" & [AMonth] & " And DatePart('d', [transdate])<=" &
[Aday] & "")

AMonth: DatePart("m",[TransDate])

ADay: DatePart("d",[transdate])

I need the interest to be calculated with or WITHOUT transactions.
I've attacked this problem by using queries, some VB, reports, etc.
with no success. Any help would be appreciated.
  #2  
Old November 13th, 2005, 02:33 AM
Rich P
Guest
 
Posts: n/a

re: interest calculation


What you do is to have 2 routines. One calculates with a transaction
and one calculates without a transaction. The trick will be in
determining if there was a transaction. If there is a transaction then
set a boolean var to true else the boolean var is false. If true then
calc with transaction. If false without transaction. If you are doing
the calcs from a table then create a new field for transactionYesNo. If
this field contains a yes... you can add that as part of your criteria
in the DSum formula
...
If...
Bal =
DSum("[transaction]*[transtype]","tblsavingstable","DatePart('m',
[transdate])<=" & [AMonth] & " And DatePart('d', [transdate])<=" &
[Aday] & " And TransactionYesNo = 'Yes'")
Else...
Bal =
DSum("[transaction]*[transtype]","tblsavingstable","DatePart('m',
[transdate])<=" & [AMonth] & " And DatePart('d', [transdate])<=" &
[Aday] & " And TransactionYesNo = 'No'")
End If
...


Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Daily Interest Calculations based on days user as signed up. tasmontique answers 0 May 9th, 2007 09:48 PM
Payment calculation for Rate discount Kawaka Ku answers 7 January 13th, 2007 01:24 PM
calculation issues pcbutts1 answers 2 July 16th, 2006 11:45 PM
compound interest calculation Dave answers 5 November 17th, 2005 08:38 AM