Login     Register

        Contact Us     Search

XLeratorDB/financial Documentation

SQL Server NPER function for odd-first period loans


NUMPMTS

Updated: 13 January 2014


Use the scalar function NUMPMTS to calculate the number of payments from the first interest payment date to the last payment date; in other words, the total number of payments over the life of the loan. The number of payments includes the first payment date. If the last payment date is not a regular payment date, then the returned value is the number of whole payment occurring before the specified date.
Syntax
SELECT [wctFinancial].[wct].[NUMPMTS](
  <@FirstPaymentDate, datetime,>
 ,<@LastPaymentDate, datetime,>
 ,<@PmtPerYear, int,>)
Arguments
@FirstPaymentDate
the first interest payment date of the loan. @FirstPaymentDate is an expression of type datetime or of a type that can be implicitly converted to datetime.
@LastPaymentDate
the last interest payment date of the loan. @LastPaymentDate is an expression of type datetime or of a type that can be implicitly converted to datetime.
@PmtPerYear
the number of payments per year. @PmtPerYear is an expression of type int or of a type that can be implicitly converted to int.
Return Type
int
Remarks
·         @PmtPerYear must be 1, 2, 3, 4, 6, 12, 13, 24, 26, 52 or 365.
Examples
In the example, we calculate the number of payments from the 31st of January, 2014 to the 31st of December, 2019.
SELECT
      wct.NUMPMTS('2014-01-31','2019-12-31',12) as NUMPMTS

This produces the following result.
    NUMPMTS
-----------
         72


Copyright 2008-2013 WestClinTech LLC         Privacy Policy        Terms of Service