Logo

ODDPV

Updated 2023-10-06 22:32:51.130000

Syntax

SELECT [westclintech].[wct].[ODDPV] (
  <@Rate, float,>
 ,<@NumPmts, int,>
 ,<@pmt, float,>
 ,<@FV, float,>
 ,<@Pmtpyr, int,>
 ,<@LoanDate, datetime,>
 ,<@FirstPayDate, datetime,>
 ,<@DaysInYr, float,>)

Description

Use the scalar-valued function ODDPV to calculate the present value of an annuity with an odd first period.

Arguments

@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.

@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.

@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.

@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 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.

@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.

@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, 365, 365360 or 365365.

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.

{"columns":[{"field":"PV","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"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.

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

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.

{"columns":[{"field":"PV","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"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.

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

Calculate the present value using a rate of 18.0% for a 5-year loan made on Sep 15th with no payments due until Jan 1st and with payments of 1,987.77 due every month after that using a 365/360 interest basis.

SELECT wct.ODDPV(   .18,          --Rate

                    60,           --Numpmts

                    1987.77,      --pmt

                    0,            --FV

                    12,           --pmtpyr

                    '09/15/2022', --loan date

                    '01/01/2023', --start date

                    365360        --daysinyr

                ) as PV;

This produces the following result.

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