473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

interest calculation

jmd
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.
Nov 13 '05 #1
1 4032
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!
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Aspersion | last post by:
I'm building an ASP page that has a lot of text and graphics. There is a calculation facility on the page. The user enters several numbers in a form and presses a button to see the calculated...
0
by: anaxamandr | last post by:
Hi. I have a long loop in ASP that performs a rather lengthy calculation. I would love for my users to be able to stop that calculation, if they so choose, mid way through the process. I attempted...
2
by: Del | last post by:
Thanks in advance for any help. I have a database that was created in Access 2000. Several users have been upgraded to Access 2003. Since upgrading to 2003 we have noticed that some of the...
4
by: Michiel Alsters | last post by:
Hello everybody, I hope anybody can help me. I'll try to give a brief overview of my problem. I have running a program that performs a heavy calculation. To give the user feedback what the...
5
by: Dave | last post by:
I need a calculation that allows for monthly calculations Dave
4
by: vg-mail | last post by:
Hello all, I have identical design for form and report but I am getting calculation error on form and everything is OK on report. The form and report are build up on SQL statement. The...
5
by: The alMIGHTY N | last post by:
Hi all, Let's say I have a simple math formula: sum (x * y / 1000) / (sum z / 1000) I have to do this across 50 items, each with an x, y and z value, when the page first loads AND when a...
0
by: tasmontique | last post by:
Hi, I am very green to asp and I am currently struggling with basic tasks in a starter kit that I am using. Please help. Here goes, 1.I want to calculate interest for users on a daily...
3
by: mattmao | last post by:
Okay, I was asked by a friend about the result of this limit: http://bbs.newwise.com/attdata/forumid_14/20070922_fe7f77c81050413a20fbDWYOGm7zeRj3.jpg Not n->zero but n-> + infinite I really...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.