Showing posts with label half. Show all posts
Showing posts with label half. Show all posts

Friday, March 9, 2012

Nominal intrest in TSQL

Hi

I have to make a calculation based on the Excel Nominal function to get the nomanal Interest

Month Quarter Half year per year 2% = 0,16516% 0,49629% 0,99505% 2,00% 3% " 0,24663% 0,74171% 1,48892% 3,00% 4% " 0,32737% 0,98534% 1,98039% 4,00% 5% " 0,40741% 1,22722% 2,46951% 5,00% 6% " 0,48676% 1,46738% 2,95630% 6,00% 7% " 0,56541% 1,70585% 3,44080% 7,00% 8% " 0,64340% 1,94265% 3,92305% 8,00% 9% " 0,72073% 2,17782% 4,40307% 9,00% 10% " 0,79741% 2,41137% 4,88088% 10,00% 11% " 0,87346% 2,64333% 5,35654% 11,00% 12% " 0,94888% 2,87373% 5,83005% 12,00%

In Exell the formula goes like this:
Per Month =NOMINAL(aIntrest;12)/12
Per Quarter =NOMINAL(aIntrest;4)/4
Half Year =NOMINAL(aIntrest;2)/2
Per Year =NOMINAL(aIntrest;1)

I would be very happy to get help on this.

I'm not entirely sure, if Excel's NOMINAL is working that way, however you can use the following to get the same results

DECLARE @.apr FLOAT
DECLARE @.frequency FLOAT

SET @.apr = 0.02
SET @.frequency = 12
SELECT (@.frequency * POWER(1+@.apr, 1/@.frequency)-@.frequency)/@.frequency AS Monthly
SET @.frequency = 4
SELECT (@.frequency * POWER(1+@.apr, 1/@.frequency)-@.frequency)/@.frequency AS Quarterly
SET @.frequency = 2
SELECT (@.frequency * POWER(1+@.apr, 1/@.frequency)-@.frequency)/@.frequency AS Semiannual
SET @.frequency = 1
SELECT (@.frequency * POWER(1+@.apr, 1/@.frequency)-@.frequency)/@.frequency AS Annual
--
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
|||

Super

Thanks, so simple