Hi MWVISA1,
Thanks for this response. I already have PMT but could you help me derive PPMT and IPMT from the code below;
>>>> Working PMT Function in MySQL
DELIMITER $$
DROP FUNCTION IF EXISTS `C245037_InterAct`.`PMT` $$
CREATE DEFINER=`C245037_biolgb`@`
mPv double,
mFv double,
mNPer int,
mApr float,
mMonths int
) RETURNS double
BEGIN
Declare mVal double;
/*
In excel it should look like this:
=PMT(A1/12,B2,-C3, D4,1)
A1 = 7.40%
B2 = 36 (Month)
C3 = 106344 (Financing)
D4 = 75960 (Rest value)
In excel the result = 1404
set Pv=106344;
set Fv=75960;
set NPer=36;
set Apr=.074;
set mMonths=12;
*/
select (mPV-mFV)/mNPER + (mPV+mFV-(mPV-mFV)/mNPER)/
return mVal;
END $$
DELIMITER ;
Main Topics
Browse All Topics





by: mwvisa1Posted on 2009-11-06 at 19:06:24ID: 25764803
http://www.techonthenet.co m/excel/fo rmulas/pmt .php /www.techo nthenet.co m/excel/fo rmulas/ipm t.php //www.tech onthenet.c om/excel/f ormulas/pp mt.php
http:/
http:
The above explain the functionality of the financial functions you mentioned as well as the PMT function. You could create a schema called Financials and then create user defined functions for each of these. You could create PMT first and then use the same logic in the others as you will need to determine the periodic payment amount to subtract at each payment to find the next balance by which interest is calculated.
HTH
M-1