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.
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.
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.
the number of payments per year. @PmtPerYear is an expression of type int or of a type that can be implicitly converted to int.
· @PmtPerYear must be 1, 2, 3, 4, 6, 12, 13, 24, 26, 52 or 365.
In the example, we calculate the number of payments from the 31st of January, 2014 to the 31st of December, 2019.
wct.NUMPMTS('2014-01-31','2019-12-31',12) as NUMPMTS
This produces the following result.