SQL Server CONSTPRINAMORT Function
Updated 2023-10-10 21:43:31.117000
Description
Use the table-valued function CONSTPRINAMORT to generate an amortization schedule for a loan with a fixed principal repayment.
Syntax
SELECT * FROM [westclintech].[wct].[CONSTPRINAMORT](
<@PV, float,>
,<@Rate, float,>
,<@LoanDate, datetime,>
,<@NumPmtsPerYear, int,>
,<@FirstPaymentDate, datetime,>
,<@DaysInYr, int,>
,<@NumberOfPayments, int,>
,<@LastPaymentNumber, int,>
,<@FirstPrinPayNo, int,>
,<@FV, float,>
,<@PPMT, float,>
,<@eom, bit,>)
Arguments
@PV
the principal amount of the loan. @PV is an expression of type float or of a type that can be implicitly converted to float.
@Rate
the annual interest rate for the loan. @Rate is an expression of type float or of a type that can be implicitly converted to float.
@LoanDate
the date that the loan starts accruing interest. @LoanDate is an expression of type datetime or of a type that can be implicitly converted to datetime.
@NumPmtsPerYear
the number of payments in a year. @NumPmtsPerYear is an expression of type int or of a type that can be implicitly converted to int.
@FirstPaymentDate
the date that the first payment is due. @FirstPaymentDate is an expression of type datetime or of a type that can be implicitly converted to datetime.
@DaysInYr
the denominator number of days to be used in the calculation of the interest. @DaysInYr is an expression of type int or of a type that can be implicitly converted to int.
@NumberOfPayments
the total number of payments to be used in the calculation principal payment amount, if a principal payment amount (@PPMT) is not entered. This may not be the actual number of payments on the loan, which can be specified by using @LastPaymentNumber. @NumberOfPayments is an expression of type int or of a type that can be implicitly converted to int.
@LastPaymentNumber
the number of the last loan payment if different than the @NumberOfPayments. @LastPaymentNumber is an expression of type int or of a type that can be implicitly converted to int.
@FirstPrinPayNo
the payment number of the first principal payment. @FirstPrinPayNo is an expression of type int or of a type that can be implicitly converted to int.
@FV
the future value at the end of the loan. @FV is an expression of type float or of a type that can be implicitly converted to float.
@PPMT
the principal payment amount. @PPMT is an expression of type float or of a type that can be implicitly converted to float.
@eom
a bit value specifying that if the @FirstPaymentDate is the last day of the month and the @NumPmtsPerYear is 1,2,4 or 12 that all subsequent payments occur on the last of the month.
Return Type
table
| colName | colDatatype | colDesc |
|---|---|---|
| num_pmt | int | The monotonically calculated payment number with the payment number on the first payment date = 1. |
| date_pmt | datetime | The date of the payment calculated chronologically from @FirstPaymentDate. |
| amt_prin_init | float | The principal amount at the beginning of the period. When num_pmt is equal to 0, the principal amount is 0, otherwise the principal amount is the ending principal amount where num_pmt = num_pmt - 1. |
| amt_pmt | float | amt_int_pay + amt_prin_pay. |
| amt_int_pay | float | The interest amount for the period. The interest amount is calculated using @Rate, @DaysInYr, and amt_prin_init. See Remarks for more information on the calculation of amt_int_pay |
| amt_prin_pay | float | The principal payment amount. See Remarks for more information. |
| amt_prin_end | float | The ending principal amount. Calculated as the beginning principal amount (amt_prin_init) less the principal payment amount for the period (amt_prin_pay). |
Remarks
If @PV is NULL then @PV = 0.
If @Rate is NULL then @Rate = 0.
If @LoanDate is NULL then @LoanDate = GETDATE().
If @NumPmtsPerYear is NULL then @NumPmtsPerYear = 12.
If @DaysInYr is NULL then @DaysInYr = 365.
If @NumberOfPayments is NULL then @NumberOfPayments = 1.
If @FirstPrinPayNo is NULL then @FirstPrinPayNo = 1.
If @LastPaymentNumber is NULL then @LastPaymentNumber = @NumberOfPayments.
If @eom is NULL then @eom = 'TRUE'.
If @FirstPaymentDate is NULL then @FirstPaymentDate is calculated using @LoanDate and @NumPmtsPerYear.
@NumPmtsPerYear must be 1, 2, 3, 4, 6, 12, 13, 24, 26, 52 or 365.
@NumberOfPayments must be greater than 0.
@DaysInYr must be 360 or 365.
If @NumberOfPayments is less than 1 then an error will be generated.
If @LastPaymentNumber is less than 1 then an error will be generated.
If @FirstPrinPayNo is less than 1 then an error will be generated.
If @PPMT is NULL than @PPMT is calculated as (@PV – ISNULL(@FV, 0) / (@NumberOfPayments - @FirstPrinPayNo + 1).
If @NumPmtsPerYear = 365, 52, 26, or 13 the amt_int_pay is calculated assuming a 365 day year. If the first interest period is an odd period, then the amt_int_pay = @PV * @Rate * (@FirstPaymentDate - @LoanDate) / 365. For all other periods, the amt_int_pay = amt_prin_init * 364/@NumPmtsPerYear/365 * @Rate.
For all other values of @NumPmtsPerYear, amt_int_pay is calculated using @DaysInYr.
If @DaysInYr = 360 and num_pmt > 1 then amt_int_pay = amt_prin_init * @Rate / @NumPmtsPerYear.
If @DaysInYr = 360 and num_pmt = 1 and @FirstPaymentDate is a regular payment date then amt_int_pay is calculated as above, otherwise the calculation is amt_int_pay = @Rate * wct.YEARFRAC(start_date, d.date_pmt,0).
If @DaysInYr = 365 and num_pmt > 1 then amt_int_pay = amt_prin_init * @Rate * wct.YEARFRAC(start_date, date_pmt,3) where start_date is date_pmt from the previous row.
Examples
A 1,000,000 loan dated 2014-05-14 with 50 monthly payments commencing on 2014-06-15. The interest rate is 6.0%.
SELECT *
FROM wct.CONSTPRINAMORT( 1000000, --@PV
.06, --@Rate
'2014-05-15', --@LoanDate
12, --@NumPmtsPerYear
'2014-06-15', --@FirstPaymentDate
360, --@DaysInYr
50, --@NumberOfPayments
NULL, --@LastPaymentNumber
NULL, --@FirstPrinPayNo
NULL, --@FV
NULL, --@PPMT
NULL --@eom
);
This produces the following result.
| num_pmt | date_pmt | amt_prin_init | amt_pmt | amt_int_pay | amt_prin_pay | amt_prin_end |
|---|---|---|---|---|---|---|
| 0 | 2014-05-15 00:00:00.000 | 0 | 0 | 0 | 0 | 1000000 |
| 1 | 2014-06-15 00:00:00.000 | 1000000 | 25000 | 5000 | 20000 | 980000 |
| 2 | 2014-07-15 00:00:00.000 | 980000 | 24900 | 4900 | 20000 | 960000 |
| 3 | 2014-08-15 00:00:00.000 | 960000 | 24800 | 4800 | 20000 | 940000 |
| 4 | 2014-09-15 00:00:00.000 | 940000 | 24700 | 4700 | 20000 | 920000 |
| 5 | 2014-10-15 00:00:00.000 | 920000 | 24600 | 4600 | 20000 | 900000 |
| 6 | 2014-11-15 00:00:00.000 | 900000 | 24500 | 4500 | 20000 | 880000 |
| 7 | 2014-12-15 00:00:00.000 | 880000 | 24400 | 4400 | 20000 | 860000 |
| 8 | 2015-01-15 00:00:00.000 | 860000 | 24300 | 4300 | 20000 | 840000 |
| 9 | 2015-02-15 00:00:00.000 | 840000 | 24200 | 4200 | 20000 | 820000 |
| 10 | 2015-03-15 00:00:00.000 | 820000 | 24100 | 4100 | 20000 | 800000 |
| 11 | 2015-04-15 00:00:00.000 | 800000 | 24000 | 4000 | 20000 | 780000 |
| 12 | 2015-05-15 00:00:00.000 | 780000 | 23900 | 3900 | 20000 | 760000 |
| 13 | 2015-06-15 00:00:00.000 | 760000 | 23800 | 3800 | 20000 | 740000 |
| 14 | 2015-07-15 00:00:00.000 | 740000 | 23700 | 3700 | 20000 | 720000 |
| 15 | 2015-08-15 00:00:00.000 | 720000 | 23600 | 3600 | 20000 | 700000 |
| 16 | 2015-09-15 00:00:00.000 | 700000 | 23500 | 3500 | 20000 | 680000 |
| 17 | 2015-10-15 00:00:00.000 | 680000 | 23400 | 3400 | 20000 | 660000 |
| 18 | 2015-11-15 00:00:00.000 | 660000 | 23300 | 3300 | 20000 | 640000 |
| 19 | 2015-12-15 00:00:00.000 | 640000 | 23200 | 3200 | 20000 | 620000 |
| 20 | 2016-01-15 00:00:00.000 | 620000 | 23100 | 3100 | 20000 | 600000 |
| 21 | 2016-02-15 00:00:00.000 | 600000 | 23000 | 3000 | 20000 | 580000 |
| 22 | 2016-03-15 00:00:00.000 | 580000 | 22900 | 2900 | 20000 | 560000 |
| 23 | 2016-04-15 00:00:00.000 | 560000 | 22800 | 2800 | 20000 | 540000 |
| 24 | 2016-05-15 00:00:00.000 | 540000 | 22700 | 2700 | 20000 | 520000 |
| 25 | 2016-06-15 00:00:00.000 | 520000 | 22600 | 2600 | 20000 | 500000 |
| 26 | 2016-07-15 00:00:00.000 | 500000 | 22500 | 2500 | 20000 | 480000 |
| 27 | 2016-08-15 00:00:00.000 | 480000 | 22400 | 2400 | 20000 | 460000 |
| 28 | 2016-09-15 00:00:00.000 | 460000 | 22300 | 2300 | 20000 | 440000 |
| 29 | 2016-10-15 00:00:00.000 | 440000 | 22200 | 2200 | 20000 | 420000 |
| 30 | 2016-11-15 00:00:00.000 | 420000 | 22100 | 2100 | 20000 | 400000 |
| 31 | 2016-12-15 00:00:00.000 | 400000 | 22000 | 2000 | 20000 | 380000 |
| 32 | 2017-01-15 00:00:00.000 | 380000 | 21900 | 1900 | 20000 | 360000 |
| 33 | 2017-02-15 00:00:00.000 | 360000 | 21800 | 1800 | 20000 | 340000 |
| 34 | 2017-03-15 00:00:00.000 | 340000 | 21700 | 1700 | 20000 | 320000 |
| 35 | 2017-04-15 00:00:00.000 | 320000 | 21600 | 1600 | 20000 | 300000 |
| 36 | 2017-05-15 00:00:00.000 | 300000 | 21500 | 1500 | 20000 | 280000 |
| 37 | 2017-06-15 00:00:00.000 | 280000 | 21400 | 1400 | 20000 | 260000 |
| 38 | 2017-07-15 00:00:00.000 | 260000 | 21300 | 1300 | 20000 | 240000 |
| 39 | 2017-08-15 00:00:00.000 | 240000 | 21200 | 1200 | 20000 | 220000 |
| 40 | 2017-09-15 00:00:00.000 | 220000 | 21100 | 1100 | 20000 | 200000 |
| 41 | 2017-10-15 00:00:00.000 | 200000 | 21000 | 1000 | 20000 | 180000 |
| 42 | 2017-11-15 00:00:00.000 | 180000 | 20900 | 900 | 20000 | 160000 |
| 43 | 2017-12-15 00:00:00.000 | 160000 | 20800 | 800 | 20000 | 140000 |
| 44 | 2018-01-15 00:00:00.000 | 140000 | 20700 | 700 | 20000 | 120000 |
| 45 | 2018-02-15 00:00:00.000 | 120000 | 20600 | 600 | 20000 | 100000 |
| 46 | 2018-03-15 00:00:00.000 | 100000 | 20500 | 500 | 20000 | 80000 |
| 47 | 2018-04-15 00:00:00.000 | 80000 | 20400 | 400 | 20000 | 60000 |
| 48 | 2018-05-15 00:00:00.000 | 60000 | 20300 | 300 | 20000 | 40000 |
| 49 | 2018-06-15 00:00:00.000 | 40000 | 20200 | 200 | 20000 | 20000 |
| 50 | 2018-07-15 00:00:00.000 | 20000 | 20100 | 100 | 20000 | 0 |
A 1,000,000 loan dated 2014-05-14 with 50 monthly payments commencing on 2014-06-30, with payments due at the end-of the month. The interest rate is 6.0%.
SELECT *
FROM wct.CONSTPRINAMORT( 1000000, --@PV
.06, --@Rate
'2014-05-15', --@LoanDate
12, --@NumPmtsPerYear
'2014-06-30', --@FirstPaymentDate
360, --@DaysInYr
50, --@NumberOfPayments
NULL, --@LastPaymentNumber
NULL, --@FirstPrinPayNo
NULL, --@FV
NULL, --@PPMT
'True' --@eom
);
This produces the following result.
| num_pmt | date_pmt | amt_prin_init | amt_pmt | amt_int_pay | amt_prin_pay | amt_prin_end |
|---|---|---|---|---|---|---|
| 0 | 2014-05-15 00:00:00.000 | 0 | 0 | 0 | 0 | 1000000 |
| 1 | 2014-06-30 00:00:00.000 | 1000000 | 27500 | 7500 | 20000 | 980000 |
| 2 | 2014-07-31 00:00:00.000 | 980000 | 24900 | 4900 | 20000 | 960000 |
| 3 | 2014-08-31 00:00:00.000 | 960000 | 24800 | 4800 | 20000 | 940000 |
| 4 | 2014-09-30 00:00:00.000 | 940000 | 24700 | 4700 | 20000 | 920000 |
| 5 | 2014-10-31 00:00:00.000 | 920000 | 24600 | 4600 | 20000 | 900000 |
| 6 | 2014-11-30 00:00:00.000 | 900000 | 24500 | 4500 | 20000 | 880000 |
| 7 | 2014-12-31 00:00:00.000 | 880000 | 24400 | 4400 | 20000 | 860000 |
| 8 | 2015-01-31 00:00:00.000 | 860000 | 24300 | 4300 | 20000 | 840000 |
| 9 | 2015-02-28 00:00:00.000 | 840000 | 24200 | 4200 | 20000 | 820000 |
| 10 | 2015-03-31 00:00:00.000 | 820000 | 24100 | 4100 | 20000 | 800000 |
| 11 | 2015-04-30 00:00:00.000 | 800000 | 24000 | 4000 | 20000 | 780000 |
| 12 | 2015-05-31 00:00:00.000 | 780000 | 23900 | 3900 | 20000 | 760000 |
| 13 | 2015-06-30 00:00:00.000 | 760000 | 23800 | 3800 | 20000 | 740000 |
| 14 | 2015-07-31 00:00:00.000 | 740000 | 23700 | 3700 | 20000 | 720000 |
| 15 | 2015-08-31 00:00:00.000 | 720000 | 23600 | 3600 | 20000 | 700000 |
| 16 | 2015-09-30 00:00:00.000 | 700000 | 23500 | 3500 | 20000 | 680000 |
| 17 | 2015-10-31 00:00:00.000 | 680000 | 23400 | 3400 | 20000 | 660000 |
| 18 | 2015-11-30 00:00:00.000 | 660000 | 23300 | 3300 | 20000 | 640000 |
| 19 | 2015-12-31 00:00:00.000 | 640000 | 23200 | 3200 | 20000 | 620000 |
| 20 | 2016-01-31 00:00:00.000 | 620000 | 23100 | 3100 | 20000 | 600000 |
| 21 | 2016-02-29 00:00:00.000 | 600000 | 23000 | 3000 | 20000 | 580000 |
| 22 | 2016-03-31 00:00:00.000 | 580000 | 22900 | 2900 | 20000 | 560000 |
| 23 | 2016-04-30 00:00:00.000 | 560000 | 22800 | 2800 | 20000 | 540000 |
| 24 | 2016-05-31 00:00:00.000 | 540000 | 22700 | 2700 | 20000 | 520000 |
| 25 | 2016-06-30 00:00:00.000 | 520000 | 22600 | 2600 | 20000 | 500000 |
| 26 | 2016-07-31 00:00:00.000 | 500000 | 22500 | 2500 | 20000 | 480000 |
| 27 | 2016-08-31 00:00:00.000 | 480000 | 22400 | 2400 | 20000 | 460000 |
| 28 | 2016-09-30 00:00:00.000 | 460000 | 22300 | 2300 | 20000 | 440000 |
| 29 | 2016-10-31 00:00:00.000 | 440000 | 22200 | 2200 | 20000 | 420000 |
| 30 | 2016-11-30 00:00:00.000 | 420000 | 22100 | 2100 | 20000 | 400000 |
| 31 | 2016-12-31 00:00:00.000 | 400000 | 22000 | 2000 | 20000 | 380000 |
| 32 | 2017-01-31 00:00:00.000 | 380000 | 21900 | 1900 | 20000 | 360000 |
| 33 | 2017-02-28 00:00:00.000 | 360000 | 21800 | 1800 | 20000 | 340000 |
| 34 | 2017-03-31 00:00:00.000 | 340000 | 21700 | 1700 | 20000 | 320000 |
| 35 | 2017-04-30 00:00:00.000 | 320000 | 21600 | 1600 | 20000 | 300000 |
| 36 | 2017-05-31 00:00:00.000 | 300000 | 21500 | 1500 | 20000 | 280000 |
| 37 | 2017-06-30 00:00:00.000 | 280000 | 21400 | 1400 | 20000 | 260000 |
| 38 | 2017-07-31 00:00:00.000 | 260000 | 21300 | 1300 | 20000 | 240000 |
| 39 | 2017-08-31 00:00:00.000 | 240000 | 21200 | 1200 | 20000 | 220000 |
| 40 | 2017-09-30 00:00:00.000 | 220000 | 21100 | 1100 | 20000 | 200000 |
| 41 | 2017-10-31 00:00:00.000 | 200000 | 21000 | 1000 | 20000 | 180000 |
| 42 | 2017-11-30 00:00:00.000 | 180000 | 20900 | 900 | 20000 | 160000 |
| 43 | 2017-12-31 00:00:00.000 | 160000 | 20800 | 800 | 20000 | 140000 |
| 44 | 2018-01-31 00:00:00.000 | 140000 | 20700 | 700 | 20000 | 120000 |
| 45 | 2018-02-28 00:00:00.000 | 120000 | 20600 | 600 | 20000 | 100000 |
| 46 | 2018-03-31 00:00:00.000 | 100000 | 20500 | 500 | 20000 | 80000 |
| 47 | 2018-04-30 00:00:00.000 | 80000 | 20400 | 400 | 20000 | 60000 |
| 48 | 2018-05-31 00:00:00.000 | 60000 | 20300 | 300 | 20000 | 40000 |
| 49 | 2018-06-30 00:00:00.000 | 40000 | 20200 | 200 | 20000 | 20000 |
| 50 | 2018-07-31 00:00:00.000 | 20000 | 20100 | 100 | 20000 | 0 |
In this example there are 26 payments per year and the principal is amortized as though the loan is maturing in 5 years, but it will be paid off, in full, in 2 years.
SELECT *
FROM wct.CONSTPRINAMORT( 1000000, --@PV
.06, --@Rate
'2014-05-15', --@LoanDate
26, --@NumPmtsPerYear
'2014-06-30', --@FirstPaymentDate
365, --@DaysInYr
130, --@NumberOfPayments
52, --@LastPaymentNumber
NULL, --@FirstPrinPayNo
NULL, --@FV
NULL, --@PPMT
NULL --@eom
);
This produces the following result.
| num_pmt | date_pmt | amt_prin_init | amt_pmt | amt_int_pay | amt_prin_pay | amt_prin_end |
|---|---|---|---|---|---|---|
| 0 | 2014-05-15 00:00:00.000 | 0 | 0 | 0 | 0 | 1000000 |
| 1 | 2014-06-30 00:00:00.000 | 1000000 | 15253.9515279241 | 7561.64383561644 | 7692.30769230769 | 992307.692307692 |
| 2 | 2014-07-14 00:00:00.000 | 992307.692307692 | 9975.97471022129 | 2283.66701791359 | 7692.30769230769 | 984615.384615385 |
| 3 | 2014-07-28 00:00:00.000 | 984615.384615385 | 9958.27186512118 | 2265.96417281349 | 7692.30769230769 | 976923.076923077 |
| 4 | 2014-08-11 00:00:00.000 | 976923.076923077 | 9940.56902002107 | 2248.26132771338 | 7692.30769230769 | 969230.769230769 |
| 5 | 2014-08-25 00:00:00.000 | 969230.769230769 | 9922.86617492097 | 2230.55848261328 | 7692.30769230769 | 961538.461538461 |
| 6 | 2014-09-08 00:00:00.000 | 961538.461538461 | 9905.16332982086 | 2212.85563751317 | 7692.30769230769 | 953846.153846154 |
| 7 | 2014-09-22 00:00:00.000 | 953846.153846154 | 9887.46048472076 | 2195.15279241307 | 7692.30769230769 | 946153.846153846 |
| 8 | 2014-10-06 00:00:00.000 | 946153.846153846 | 9869.75763962065 | 2177.44994731296 | 7692.30769230769 | 938461.538461538 |
| 9 | 2014-10-20 00:00:00.000 | 938461.538461538 | 9852.05479452055 | 2159.74710221285 | 7692.30769230769 | 930769.23076923 |
| 10 | 2014-11-03 00:00:00.000 | 930769.23076923 | 9834.35194942044 | 2142.04425711275 | 7692.30769230769 | 923076.923076923 |
| 11 | 2014-11-17 00:00:00.000 | 923076.923076923 | 9816.64910432034 | 2124.34141201264 | 7692.30769230769 | 915384.615384615 |
| 12 | 2014-12-01 00:00:00.000 | 915384.615384615 | 9798.94625922023 | 2106.63856691254 | 7692.30769230769 | 907692.307692307 |
| 13 | 2014-12-15 00:00:00.000 | 907692.307692307 | 9781.24341412012 | 2088.93572181243 | 7692.30769230769 | 899999.999999999 |
| 14 | 2014-12-29 00:00:00.000 | 899999.999999999 | 9763.54056902002 | 2071.23287671233 | 7692.30769230769 | 892307.692307692 |
| 15 | 2015-01-12 00:00:00.000 | 892307.692307692 | 9745.83772391991 | 2053.53003161222 | 7692.30769230769 | 884615.384615384 |
| 16 | 2015-01-26 00:00:00.000 | 884615.384615384 | 9728.13487881981 | 2035.82718651212 | 7692.30769230769 | 876923.076923076 |
| 17 | 2015-02-09 00:00:00.000 | 876923.076923076 | 9710.4320337197 | 2018.12434141201 | 7692.30769230769 | 869230.769230768 |
| 18 | 2015-02-23 00:00:00.000 | 869230.769230768 | 9692.7291886196 | 2000.42149631191 | 7692.30769230769 | 861538.461538461 |
| 19 | 2015-03-09 00:00:00.000 | 861538.461538461 | 9675.02634351949 | 1982.7186512118 | 7692.30769230769 | 853846.153846153 |
| 20 | 2015-03-23 00:00:00.000 | 853846.153846153 | 9657.32349841939 | 1965.01580611169 | 7692.30769230769 | 846153.846153845 |
| 21 | 2015-04-06 00:00:00.000 | 846153.846153845 | 9639.62065331928 | 1947.31296101159 | 7692.30769230769 | 838461.538461537 |
| 22 | 2015-04-20 00:00:00.000 | 838461.538461537 | 9621.91780821918 | 1929.61011591148 | 7692.30769230769 | 830769.23076923 |
| 23 | 2015-05-04 00:00:00.000 | 830769.23076923 | 9604.21496311907 | 1911.90727081138 | 7692.30769230769 | 823076.923076922 |
| 24 | 2015-05-18 00:00:00.000 | 823076.923076922 | 9586.51211801896 | 1894.20442571127 | 7692.30769230769 | 815384.615384614 |
| 25 | 2015-06-01 00:00:00.000 | 815384.615384614 | 9568.80927291886 | 1876.50158061117 | 7692.30769230769 | 807692.307692306 |
| 26 | 2015-06-15 00:00:00.000 | 807692.307692306 | 9551.10642781875 | 1858.79873551106 | 7692.30769230769 | 799999.999999999 |
| 27 | 2015-06-29 00:00:00.000 | 799999.999999999 | 9533.40358271865 | 1841.09589041096 | 7692.30769230769 | 792307.692307691 |
| 28 | 2015-07-13 00:00:00.000 | 792307.692307691 | 9515.70073761854 | 1823.39304531085 | 7692.30769230769 | 784615.384615383 |
| 29 | 2015-07-27 00:00:00.000 | 784615.384615383 | 9497.99789251844 | 1805.69020021074 | 7692.30769230769 | 776923.076923075 |
| 30 | 2015-08-10 00:00:00.000 | 776923.076923075 | 9480.29504741833 | 1787.98735511064 | 7692.30769230769 | 769230.769230768 |
| 31 | 2015-08-24 00:00:00.000 | 769230.769230768 | 9462.59220231823 | 1770.28451001053 | 7692.30769230769 | 761538.46153846 |
| 32 | 2015-09-07 00:00:00.000 | 761538.46153846 | 9444.88935721812 | 1752.58166491043 | 7692.30769230769 | 753846.153846152 |
| 33 | 2015-09-21 00:00:00.000 | 753846.153846152 | 9427.18651211801 | 1734.87881981032 | 7692.30769230769 | 746153.846153844 |
| 34 | 2015-10-05 00:00:00.000 | 746153.846153844 | 9409.48366701791 | 1717.17597471022 | 7692.30769230769 | 738461.538461537 |
| 35 | 2015-10-19 00:00:00.000 | 738461.538461537 | 9391.7808219178 | 1699.47312961011 | 7692.30769230769 | 730769.230769229 |
| 36 | 2015-11-02 00:00:00.000 | 730769.230769229 | 9374.0779768177 | 1681.77028451001 | 7692.30769230769 | 723076.923076921 |
| 37 | 2015-11-16 00:00:00.000 | 723076.923076921 | 9356.37513171759 | 1664.0674394099 | 7692.30769230769 | 715384.615384613 |
| 38 | 2015-11-30 00:00:00.000 | 715384.615384613 | 9338.67228661749 | 1646.3645943098 | 7692.30769230769 | 707692.307692306 |
| 39 | 2015-12-14 00:00:00.000 | 707692.307692306 | 9320.96944151738 | 1628.66174920969 | 7692.30769230769 | 699999.999999998 |
| 40 | 2015-12-28 00:00:00.000 | 699999.999999998 | 9303.26659641728 | 1610.95890410958 | 7692.30769230769 | 692307.69230769 |
| 41 | 2016-01-11 00:00:00.000 | 692307.69230769 | 9285.56375131717 | 1593.25605900948 | 7692.30769230769 | 684615.384615382 |
| 42 | 2016-01-25 00:00:00.000 | 684615.384615382 | 9267.86090621707 | 1575.55321390937 | 7692.30769230769 | 676923.076923075 |
| 43 | 2016-02-08 00:00:00.000 | 676923.076923075 | 9250.15806111696 | 1557.85036880927 | 7692.30769230769 | 669230.769230767 |
| 44 | 2016-02-22 00:00:00.000 | 669230.769230767 | 9232.45521601686 | 1540.14752370916 | 7692.30769230769 | 661538.461538459 |
| 45 | 2016-03-07 00:00:00.000 | 661538.461538459 | 9214.75237091675 | 1522.44467860906 | 7692.30769230769 | 653846.153846151 |
| 46 | 2016-03-21 00:00:00.000 | 653846.153846151 | 9197.04952581664 | 1504.74183350895 | 7692.30769230769 | 646153.846153844 |
| 47 | 2016-04-04 00:00:00.000 | 646153.846153844 | 9179.34668071654 | 1487.03898840885 | 7692.30769230769 | 638461.538461536 |
| 48 | 2016-04-18 00:00:00.000 | 638461.538461536 | 9161.64383561643 | 1469.33614330874 | 7692.30769230769 | 630769.230769228 |
| 49 | 2016-05-02 00:00:00.000 | 630769.230769228 | 9143.94099051633 | 1451.63329820863 | 7692.30769230769 | 623076.92307692 |
| 50 | 2016-05-16 00:00:00.000 | 623076.92307692 | 9126.23814541622 | 1433.93045310853 | 7692.30769230769 | 615384.615384613 |
| 51 | 2016-05-30 00:00:00.000 | 615384.615384613 | 9108.53530031612 | 1416.22760800842 | 7692.30769230769 | 607692.307692305 |
| 52 | 2016-06-13 00:00:00.000 | 607692.307692305 | 609090.832455213 | 1398.52476290832 | 607692.307692305 | 0 |
In this example, no interest is due until the 14th installment and then the principal will be paid down by 25,000 with each payment with balance paid off at maturity.
SELECT *
FROM wct.CONSTPRINAMORT( 1000000, --@PV
.06, --@Rate
'2014-05-15', --@LoanDate
26, --@NumPmtsPerYear
'2014-06-30', --@FirstPaymentDate
365, --@DaysInYr
52, --@NumberOfPayments
NULL, --@LastPaymentNumber
14, --@FirstPrinPayNo
NULL, --@FV
25000, --@PPMT
NULL --@eom
);
This produces the following result.
| num_pmt | date_pmt | amt_prin_init | amt_pmt | amt_int_pay | amt_prin_pay | amt_prin_end |
|---|---|---|---|---|---|---|
| 0 | 2014-05-15 00:00:00.000 | 0 | 0 | 0 | 0 | 1000000 |
| 1 | 2014-06-30 00:00:00.000 | 1000000 | 7561.64383561644 | 7561.64383561644 | 0 | 1000000 |
| 2 | 2014-07-14 00:00:00.000 | 1000000 | 2301.3698630137 | 2301.3698630137 | 0 | 1000000 |
| 3 | 2014-07-28 00:00:00.000 | 1000000 | 2301.3698630137 | 2301.3698630137 | 0 | 1000000 |
| 4 | 2014-08-11 00:00:00.000 | 1000000 | 2301.3698630137 | 2301.3698630137 | 0 | 1000000 |
| 5 | 2014-08-25 00:00:00.000 | 1000000 | 2301.3698630137 | 2301.3698630137 | 0 | 1000000 |
| 6 | 2014-09-08 00:00:00.000 | 1000000 | 2301.3698630137 | 2301.3698630137 | 0 | 1000000 |
| 7 | 2014-09-22 00:00:00.000 | 1000000 | 2301.3698630137 | 2301.3698630137 | 0 | 1000000 |
| 8 | 2014-10-06 00:00:00.000 | 1000000 | 2301.3698630137 | 2301.3698630137 | 0 | 1000000 |
| 9 | 2014-10-20 00:00:00.000 | 1000000 | 2301.3698630137 | 2301.3698630137 | 0 | 1000000 |
| 10 | 2014-11-03 00:00:00.000 | 1000000 | 2301.3698630137 | 2301.3698630137 | 0 | 1000000 |
| 11 | 2014-11-17 00:00:00.000 | 1000000 | 2301.3698630137 | 2301.3698630137 | 0 | 1000000 |
| 12 | 2014-12-01 00:00:00.000 | 1000000 | 2301.3698630137 | 2301.3698630137 | 0 | 1000000 |
| 13 | 2014-12-15 00:00:00.000 | 1000000 | 2301.3698630137 | 2301.3698630137 | 0 | 1000000 |
| 14 | 2014-12-29 00:00:00.000 | 1000000 | 27301.3698630137 | 2301.3698630137 | 25000 | 975000 |
| 15 | 2015-01-12 00:00:00.000 | 975000 | 27243.8356164384 | 2243.83561643836 | 25000 | 950000 |
| 16 | 2015-01-26 00:00:00.000 | 950000 | 27186.301369863 | 2186.30136986301 | 25000 | 925000 |
| 17 | 2015-02-09 00:00:00.000 | 925000 | 27128.7671232877 | 2128.76712328767 | 25000 | 900000 |
| 18 | 2015-02-23 00:00:00.000 | 900000 | 27071.2328767123 | 2071.23287671233 | 25000 | 875000 |
| 19 | 2015-03-09 00:00:00.000 | 875000 | 27013.698630137 | 2013.69863013699 | 25000 | 850000 |
| 20 | 2015-03-23 00:00:00.000 | 850000 | 26956.1643835616 | 1956.16438356164 | 25000 | 825000 |
| 21 | 2015-04-06 00:00:00.000 | 825000 | 26898.6301369863 | 1898.6301369863 | 25000 | 800000 |
| 22 | 2015-04-20 00:00:00.000 | 800000 | 26841.095890411 | 1841.09589041096 | 25000 | 775000 |
| 23 | 2015-05-04 00:00:00.000 | 775000 | 26783.5616438356 | 1783.56164383562 | 25000 | 750000 |
| 24 | 2015-05-18 00:00:00.000 | 750000 | 26726.0273972603 | 1726.02739726027 | 25000 | 725000 |
| 25 | 2015-06-01 00:00:00.000 | 725000 | 26668.4931506849 | 1668.49315068493 | 25000 | 700000 |
| 26 | 2015-06-15 00:00:00.000 | 700000 | 26610.9589041096 | 1610.95890410959 | 25000 | 675000 |
| 27 | 2015-06-29 00:00:00.000 | 675000 | 26553.4246575342 | 1553.42465753425 | 25000 | 650000 |
| 28 | 2015-07-13 00:00:00.000 | 650000 | 26495.8904109589 | 1495.8904109589 | 25000 | 625000 |
| 29 | 2015-07-27 00:00:00.000 | 625000 | 26438.3561643836 | 1438.35616438356 | 25000 | 600000 |
| 30 | 2015-08-10 00:00:00.000 | 600000 | 26380.8219178082 | 1380.82191780822 | 25000 | 575000 |
| 31 | 2015-08-24 00:00:00.000 | 575000 | 26323.2876712329 | 1323.28767123288 | 25000 | 550000 |
| 32 | 2015-09-07 00:00:00.000 | 550000 | 26265.7534246575 | 1265.75342465753 | 25000 | 525000 |
| 33 | 2015-09-21 00:00:00.000 | 525000 | 26208.2191780822 | 1208.21917808219 | 25000 | 500000 |
| 34 | 2015-10-05 00:00:00.000 | 500000 | 26150.6849315069 | 1150.68493150685 | 25000 | 475000 |
| 35 | 2015-10-19 00:00:00.000 | 475000 | 26093.1506849315 | 1093.15068493151 | 25000 | 450000 |
| 36 | 2015-11-02 00:00:00.000 | 450000 | 26035.6164383562 | 1035.61643835616 | 25000 | 425000 |
| 37 | 2015-11-16 00:00:00.000 | 425000 | 25978.0821917808 | 978.082191780822 | 25000 | 400000 |
| 38 | 2015-11-30 00:00:00.000 | 400000 | 25920.5479452055 | 920.547945205479 | 25000 | 375000 |
| 39 | 2015-12-14 00:00:00.000 | 375000 | 25863.0136986301 | 863.013698630137 | 25000 | 350000 |
| 40 | 2015-12-28 00:00:00.000 | 350000 | 25805.4794520548 | 805.479452054794 | 25000 | 325000 |
| 41 | 2016-01-11 00:00:00.000 | 325000 | 25747.9452054795 | 747.945205479452 | 25000 | 300000 |
| 42 | 2016-01-25 00:00:00.000 | 300000 | 25690.4109589041 | 690.41095890411 | 25000 | 275000 |
| 43 | 2016-02-08 00:00:00.000 | 275000 | 25632.8767123288 | 632.876712328767 | 25000 | 250000 |
| 44 | 2016-02-22 00:00:00.000 | 250000 | 25575.3424657534 | 575.342465753425 | 25000 | 225000 |
| 45 | 2016-03-07 00:00:00.000 | 225000 | 25517.8082191781 | 517.808219178082 | 25000 | 200000 |
| 46 | 2016-03-21 00:00:00.000 | 200000 | 25460.2739726027 | 460.27397260274 | 25000 | 175000 |
| 47 | 2016-04-04 00:00:00.000 | 175000 | 25402.7397260274 | 402.739726027397 | 25000 | 150000 |
| 48 | 2016-04-18 00:00:00.000 | 150000 | 25345.2054794521 | 345.205479452055 | 25000 | 125000 |
| 49 | 2016-05-02 00:00:00.000 | 125000 | 25287.6712328767 | 287.671232876712 | 25000 | 100000 |
| 50 | 2016-05-16 00:00:00.000 | 100000 | 25230.1369863014 | 230.13698630137 | 25000 | 75000 |
| 51 | 2016-05-30 00:00:00.000 | 75000 | 25172.602739726 | 172.602739726027 | 25000 | 50000 |
| 52 | 2016-06-13 00:00:00.000 | 50000 | 50115.0684931507 | 115.068493150685 | 50000 | 0 |
See Also
AMORTIZECASHFLOWS - Discounted cash flow schedule
AMORTSCHED - Amortization schedule for a loan with constant periodic payments