Login     Register

        Contact Us     Search

XLeratorDB/financial Documentation

SQL Server present value odd-first period annuitues


ODDPV

Updated: 11 May 2012


Use the scalar-valued function ODDPV to calculate the present value of an annuity with an odd first period.
Syntax
SELECT [wctFinancial].[wct].[ODDPV] (
  <@Rate, float,>
 ,<@NumPmts, int,>
 ,<@pmt, float,>
 ,<@FV, float,>
 ,<@Pmtpyr, int,>
 ,<@LoanDate, datetime,>
 ,<@FirstPayDate, datetime,>
 ,<@DaysInYr, float,>)
Arguments
@Rate
the annual interest rate. @Rate is an expression of type float or of a type that can be implicitly converted to float.
@NumPmts
the total number of payment over the life of the annuity to be calculated. @NumPmts is an expression of type int or of a type that can be implicitly converted to int.
@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.
@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.
@Pmtpyr
the number of payments made in a year. @Pmtpyr is an expression of type float or of a type that can be implicitly converted to float.
@LoanDate
the interest start date for the annuity. @LoanDate is an expression of type datetime or of a type that can be implicitly converted to datetime.
@FirstPayDate
the date the first payment is due. @FirstPayDate is an expression of type datetime or of a type that can be implicitly converted to datetime.
@DaysInYr
the denominator number of days to be used in the calculation of the interest amount in the odd first period. @DaysInYr is an expression of type int or of a type that can be implicitly converted to int.
Return Type
float
Remarks
·         If @DaysInYr is NULL, then @DaysInYr = 360
·         If @FV is NULL, then @FV = 0
·         If @IntRule is NULL, then @IntRule = “A”
·         @FirstPayDate must be greater than @LoanDate
·         @Pmtpyr must be 1, 2, 3, 4, 5, 6, 12, 13, 24, 26, 52, or 365
·         @NumPmts must be greater than 1
·         @Rate must be greater than zero
·         @DaysInYr must be 360, 364, or 365
Examples
Calculate the present value, using a rate of 6.0%, for a 5-year loan starting on 1 November with payments due on the first of every month, having a monthly payment of 966.64. The rate on the loan is 6 per cent.
SELECT wct.ODDPV(
      .06                     --Rate
      ,60                     --Numpmts
      ,966.64                 --pmt
      ,0                      --FV
      ,12                     --pmtpyr
      ,'11/01/2010'           --loan date
      ,'12/01/2010'           --start date
      ,NULL                   --daysinyr
      ) as PV
This produces the following result.
                    PV
----------------------
     -49999.9960444733
Calculate the present value, using a rate of 6.0%, for a 5-year loan starting on 1 November with payments due every 4 weeks, starting on 1 December. Each payment is 892.42
SELECT wct.ODDPV(
      .06                     --Rate
      ,65                     --Numpmts
      ,892.42                 --pmt
      ,0                      --FV
      ,13                     --pmtpyr
      ,'11/01/2010'           --loan date
      ,'12/01/2010'           --start date
      ,NULL                   --daysinyr
      ) as PV
This produces the following result.
                    PV
----------------------
     -50000.1523538507
Calculate the present value using a rate of 6.0% for a 5-year loan starting on 1 November with payments due semi-monthly, starting on 1 December. The loan has a balloon payment of 10,000 at the end and the periodic payment is 412.45.
SELECT wct.ODDPV(
      .06                     --Rate
      ,120                    --Numpmts
      ,412.45                 --pmt
      ,10000                  --FV
      ,24                     --pmtpyr
      ,'11/01/2010'           --loan date
      ,'12/01/2010'           --start date
      ,360                    --daysinyr
      ) as PV
This produces the following result.
                    PV
----------------------
     -50000.3121743558
Calculate the present value using a rate of 12.0% for a 4-year loan made on 13 October with no payments due until 4 January and with payments of 3,710.27 due every 4 weeks after that.
SELECT wct.ODDPV(
      .12                     --Rate
      ,52                     --Numpmts
      ,3710.27                --pmt
      ,0                      --FV
      ,13                     --pmtpyr
      ,'10/13/2010'           --loan date
      ,'01/04/2011'           --start date
      ,365                    --daysinyr
      ) as PV
This produces the following result.
                    PV
----------------------
     -149996.518525048
 


Copyright 2008-2017 Westclintech LLC         Privacy Policy        Terms of Service