Solved

Calculate APY in Access

Posted on 2004-08-31
2
340 Views
Last Modified: 2009-12-16
Hello, I have an access table that has these two fiedls - TERM and RATE. To calculate the APY, currently I have to export this table to excel and run this formula:
=((1+RATE/100)^(TRUNC(TERM/12))*(1+(RATE/100*(TERM-TRUNC(TERM/12)*12))^(12/TERM)-1. Then, I have to import the excel file back into access and perform the rest of the queries.
Is there a way to perform this calculation in access? Thank you
0
Comment
Question by:lnchopo
2 Comments
 
LVL 4

Expert Comment

by:naivad
ID: 11943107
I think your problem is with the TRUNC function.

Try changing it to INT, (look up help on INT and FIX to see which function is better for you. Both drop the decimals, but handle negative numbers differently.)

=((1+RATE/100)^(INT(TERM/12))*(1+(RATE/100*(TERM-INT(TERM/12)*12))^(12/TERM)-1)
0
 
LVL 41

Accepted Solution

by:
shanesuebsahakarn earned 250 total points
ID: 11943113
You can use this expression in a query:

((1+[RATE]/100)^(Fix([TERM]/12))*([RATE]/100*([TERM]-Fix([TERM]/12)*12))^(12/[TERM])-1

In other words, you can write a query like this:
SELECT *, ((1+[RATE]/100)^(Fix([TERM]/12))*([RATE]/100*([TERM]-Fix([TERM]/12)*12))^(12/[TERM])-1 As APY FROM MyTable

This will return all of the fields in your table, plus a calculated field called APY with the results of your calculation.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Dateadd 3 22
Aceess 2016 - Variable Data Fields? 12 46
Resize text 4 16
Access Run-time error '6' Overflow 5 13
Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now