Logo

CUMIPMT

Updated 2023-10-06 21:31:47.517000

Syntax

SELECT [westclintech].[wct].[CUMIPMT] (
  <@Rate, float,>
 ,<@Nper, float,>
 ,<@PV, float,>
 ,<@Start_period, int,>
 ,<@End_period, int,>
 ,<@Pay_type, int,>)

Description

Use the scalar function CUMIPMT to calculate the cumulative interest 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.

@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 period in the annuity for which the principal payment is being 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, CUMIPMT returns an error.

If @Start_period < 1, @End_period <1, or @Start_period > @End_period, CUMIPMT returns an error.

If @Pay_type is any number other than 0 or 1, CUMIPMT return an error.

Examples

SELECT wct.CUMIPMT(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":"568.35255468914"}]}