Logo

PV

Updated 2023-10-06 23:18:40.860000

Syntax

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

Description

Use the scalar function PV to calculate the present value of an investment.

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":157},{"field":"If payments are due","width":192}],"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"}]}

@Pmt

the payment made each period. @Pmt cannot change over the life of the annuity. @Pmt 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.

@FV

the future value at the end of the annuity. @FV 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.

Return Type

float

Remarks

PV performs the following calculation:PV = (( @Pmt * k) / @Rate ) - @FVPV = PV / ((1 + @Rate ) ^ @Nper )PV = PV - ( @Pmt * k) / @RateIf @Pay_type = 0 Then k = 1 Else k = 1 + @Rate

Examples

SELECT wct.PV(0.08 / 12e+00, 20 * 12, 500, 0, 0);

Here is the result set.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"-59777.1458511878"}]}

See Also

ODDPV - Calculate the present value of an annuity with an odd first period

PVGA - Calculate the present value of a growing annuity.

PMT - Calculate the periodic payment for an annuity

RATE - Rate of an annuity given number of periods, periodic payment, present value, and future value

NPER - number of periods in an annuity

IPMT - Calculate the interest portion of a periodic payment

PPMT - principal portion of an annuity