Logo

SQL Server RRI Function

Updated 2024-02-29 14:37:50.967000

Description

Use the scalar function RRI to calculate an equivalent interest rate for the growth of an investment. The formula is:

RRI=\left(\frac{FV}{PV}\right)^\frac{1}{nper}-1

Where

column 1column 2column 3
FV=the future value of the investment
PV=the present value of the investment
nper=the number of periods.

Syntax

   SELECT [wct].[RRI] (
      <@Nper, float,>
     ,<@PV, float,>
     ,<@FV, float,>)

Arguments

@Nper

Number of periods. @Nper must be of 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.

@FV

Future value of the investment. @FV must of a 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 @Nper is NULL then @Nper = 0.

If @Nper = 0 then NULL is returned.

Examples

SELECT wct.RRI(   36,   --@Nper
                  1000, --@PV
                  1100  --@FV
              ) as RRI;

This produces the following result.

RRI
0.00265101273081281

See Also

PDURATION - Calculate the number of periods required by an investment to reach a specified value.

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