CUMPRINC
Updated 2023-06-15 21:29:23.783000
Syntax
SELECT [westclintech].[wct].[CUMPRINC] (
<@Rate, float,>
,<@Nper, float,>
,<@PV, float,>
,<@Start_period, int,>
,<@End_period, int,>
,<@Pay_type, int,>)
Description
Use CUMPRINC to calculate the cumulative principal paid on a loan between any two periods.
Arguments
@Pay_type
the number 0 or 1 and indicates when payments are due. @Pay_type is an expression of type int or of a type that can be implicitly converted to int. If @Pay_type is NULL it is assumed to be 0.
{"columns":[{"field":"Set @Pay_type equal to","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell","width":169},{"field":"If payments are due","width":210}],"rows":[{"Set @Pay_type equal to":"0","If payments are due":"At the end of a period"},{"Set @Pay_type equal to":"1","If payments are due":"At the beginning of a period"}]}
@End_period
the last period in the calculation. Payment periods are numbered beginning with 1. @End_period is an expression of type int or of a type that can be implicitly converted to int. @Pay_type
@PV
the present value of the future payments . @PV is an expression of type float or of a type that can be implicitly converted to float.
@Rate
the interest rate per period. @Rate is an expression of type float or of a type that can be implicitly converted to float.
@Nper
the total number of periods in the annuity to be calculated. @Nper is an expression of type float or of a type that can be implicitly converted to float.
@Start_period
the first period in the calculation. Payment periods are numbered beginning with 1. @Start_period is an expression of type int or of a type that can be implicitly converted to int.
Return Type
float
Remarks
If@Rate <= 0, @Nper <= 0, or @PV <= 0, CUMPRINC returns an error
If @Start_period < 1, @End_period < 1, or @Start_period > @End_period, CIMPRINC returns an error
If @Pay_type is any number other than 0 or 1, CUMPRINC returns an error
Examples
SELECT wct.CUMPRINC(0.0075
,360
,-125000
,349
,360
,0);
Here is the result set.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"11500.9866994826"}]}