Logo

PDURATION

Updated 2024-02-28 20:29:28.027000

Syntax

   SELECT [westclintech].[wct].[PDURATION] (
      <@Rate, float,>
     ,<@PV, float,>
     ,<@FV, float,>)

Description

Use the scalar function PDURATION to calculate the number of periods required by an investment to reach a specified value. The formula is:

PDURATION=\frac{\ln{fv}-\ln{pv}}{\ln{\left(rate+1\right)}

Where

{"columns":[{"field":"column 1"},{"field":"column 2"},{"field":"column 3"}],"rows":[{"column 1":"fv","column 2":"=","column 3":"the future value of the investment"},{"column 1":"pv","column 2":"=","column 3":"the present value of the investment"},{"column 1":"rate","column 2":"=","column 3":"the periodic interest rate."}]}

Arguments

@Rate

Periodic interest rate. @Rate must be of type float or of a type that implicitly converts to float.

@FV

Future value of the investment. @FV must of a type float or of a type that implicitly converts to float.

@PV

Present value of the investment. @PV must be of type float or of a type that implicitly converts to float.

Return Type

float

Remarks

If @PV is NULL then @PV = 0.

If @PV = 0 then NULL is returned.

If @FV is NULL then @FV = 0.

If @FV = 0 then NULL is returned.

If @Rate is NULL then @Rate = 0.

If @Rate = 0 then NULL is returned.

If @Rate < -1 then NULL is returned.

Examples

SELECT wct.PDURATION(   wct.PERIODRATE(.08, 1, 12) / 12, --@Rate

                        1000,                            --@PV

                        1259.712                         --@FV

                    ) as PDURATION;

This produces the following result.

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

See Also

RRI - Calculate an equivalent interest rate for the growth of an investment.

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

NPER - number of periods in an annuity

PV - Present value of an annuity

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

LRATE - annual interest rate for an annuity with an odd first period