Logo

TOTALINT

Updated 2023-10-11 14:41:29.067000

Syntax

SELECT [westclintech].[wct].[TOTALINT] (
  <@Nper, float,>
 ,<@Pmt, float,>
 ,<@PV, float,>
 ,<@FV, float,>)

Description

Use the scalar function TOTALINT to calculate the total interest on a loan or lease.

Arguments

@FV

The residual amount of the loan or lease. @FV is an expression of type float or of a type that can implicitly be converted to float.

@Nper

The number of periods in the loan or lease. @Nper is an expression of type float or of a type that can be implicitly converted to float.

@Pmt

The payment amount of the loan or lease. @Pmt is an expression of type float or of a type that can be implicitly converted to float.

@PV

The amount of the loan or lease. @PV is an expression of type float or of a type that can be implicitly converted to float.

Return Type

float

Remarks

@Nper must greater than 1

TOTALINT expects, but does not require, that @PV, @FV, and @PMT all have the same sign.

Examples

Calculate the total interest on a $3,000 loan with 15 monthly payments of $215.

SELECT wct.TOTALINT(   15,   --Number of payments

                       215,  --Monthly payment

                       3000, --Amount of the loan

                       0     --residual value 

                   ) as TOTALINT;

This returns the following result.

{"columns":[{"field":"TOTALINT","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"TOTALINT":"225"}]}

Calculate the total interest on a $30,000 loan with a $5,000 balloon payment at the end of 48 periods and a payment amount $595.02

SELECT wct.TOTALINT(   48,     --Number of payments

                       595.02, --Monthly payment

                       30000,  --Amount of the loan

                       5000    --residual value 

                   ) as TOTALINT;

This produces the following result.

{"columns":[{"field":"TOTALINT","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"TOTALINT":"3560.96"}]}