MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Sasha Pachev Date:September 5 1999 9:50pm
Subject:Re: Financial Function Problem
View as plain text  
Clive Smart wrote:
> 
> Hi there,
> 
> This may be a bit of the mark, but it is related to a MySQL project.
> 
> I need to calculate loan repayments. There is a function in C++ & Vb -
> PMT. Does any one know
> how I can do this in MySQL? Below is an explanation of the Vb function.
> I do not need to include
> future value and for type I assume payment at the beginning of the
> period.
> 
> Any help would be appreciated
> 
> Clive Smart
> 
> ----------------------
> Calculates the payment for a loan based on constant payments and a
> constant interest rate.
> 
> Syntax
> 
> PMT(rate,nper,pv,fv,type)
> 
> For a more complete description of the arguments in PMT, see PV.
> 
> Rate   is the interest rate for the loan.
> 
> Nper   is the total number of payments for the loan.
> 
> Pv   is the present value, or the total amount that a series of future
> payments is worth now; also known as the principal.
> 
> Fv   is the future value, or a cash balance you want to attain after the
> last payment is made. If fv is omitted, it is assumed to be 0 (zero),
> that is, the future value of a loan is 0.
> 
> Type   is the number 0 (zero) or 1 and indicates when payments are due.
> ----------------------------------
> 

You need a UDF ( User Defined function). The manual documents it very
well how to code one and add it to mysql. We might include one in the
future versions of mysql, if there is enough demand for it.

-- 
Sasha Pachev
http://www.sashanet.com
Thread
Financial Function ProblemClive Smart5 Sep
  • Re: Financial Function ProblemSasha Pachev6 Sep