ACCINTACT
Updated 2024-03-23 22:19:22.850000
Syntax
SELECT [wct].[ACCINTACT](
<@Settlement, datetime,>
,<@Maturity, datetime,>
,<@Rate, float,>
,<@Par, float,>
,<@Frequency, float,>
,<@Basis, nvarchar(4000),>)
Description
Use the scalar function ACCINTACT to calculate the accrued interest on a bond where the coupon amounts are calculated as the actual number of days in the coupon period divided by the number of days in the year. This means that the coupon amounts will vary by period. The number of days in the year is either 360, 365, or 366 based upon the day-count convention.
Arguments
@Basis
is the type of day count to use. @Basis is an expression of the character string data type category.
{"columns":[{"field":"@Basis","width":305},{"field":"Day count basis","width":270}],"rows":[{"@Basis":"1 , 'ACTUAL'","Day count basis":"Actual/Actual"},{"@Basis":"2 , 'A360'","Day count basis":"Actual/360"},{"@Basis":"3 , 'A365'","Day count basis":"Actual/365"},{"@Basis":"11 , 'ACTUAL NON-EOM'","Day count basis":"Actual/Actual non-end-of-month"},{"@Basis":"12 , 'A360 NON-EOM'","Day count basis":"Actual/360 non-end-of-month"},{"@Basis":"13 , 'A365 NON-EOM'","Day count basis":"Actual/365 non-end-of-month"}]}
@Frequency
the number of coupon payments per year. For annual payments, @Frequency = 1; for semi-annual, @Frequency = 2; for quarterly, @Frequency = 4; for bi-monthly, @Frequency = 6, for monthly, @Frequency = 12. @Frequency is an expression of type float or of a type that can be implicitly converted to float.
@Rate
the security’s annual coupon rate. @Rate is an expression of type float or of a type that can be implicitly converted to float.
@Par
the par value of the security. Any forced redemptions are subtracted from the par value on the redemption date and the adjusted balance is used in calculating the subsequent coupon interest. @Par is an expression of type float or of a type that can be implicitly converted to float.
@Settlement
the settlement date of the security. @Settlement is an expression that returns a datetime or smalldatetime value, or a character string in date format.
@Maturity
the maturity date of the security. @Maturity is an expression that returns a datetime or smalldatetime value, or a character string in date format.
Return Type
float
Remarks
If @Basis is invalid then ACCINTACT returns an error.
If @Frequency is invalid then ACCINTACT returns an error.
If @Maturity < @Settlement then NULL is returned.
If @Settlement is NULL, @Settlement = GETDATE().
If @Frequency is NULL, @Frequency = 2.
If @Basis is NULL, @Basis = 1.
If @Par is NULL then @Par = 100.
If @Rate is NULL then @Rate = 0.
If @Maturity is NULL then ACCINTACT returns NULL.
If @Basis = 3 or @Basis = 13 then the number of days in a year is always 365.
If @Basis =2 or @Basis = 12 then the number of days in a year is always 360.
If @Basis =1 or @Basis = 1 then the number of days in a year is determined by the actual number of days in the year of coupon period end date.
Examples
In this example we calculate the accrued interest on a bond maturing on 2034-11-01 with a coupon interest rate of 11.0% paying interest semi-annually. The bond is settling on 2014-10-29. The bond uses the actual/actual day-count convention.
SELECT wct.ACCINTACT( '2014-10-29', --@Settlement
'2034-11-01', --@Maturity
0.11, --@Rate
100, --@Par
2, --@Frequency
1 --@Basis
) as [Accrued Interest];
This produces the following result.
{"columns":[{"field":"Accrued Interest","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"Accrued Interest":"5.45479452054794"}]}
Let's compare this to the result returned by the BONDINT function.
SELECT wct.ACCINTACT( '2014-10-29', --@Settlement
'2034-11-01', --@Maturity
0.11, --@Rate
100, --@Par
2, --@Frequency
1 --@Basis
) as ACCINTACT,
wct.BONDINT( '2014-10-29', --@Settlement
'2034-11-01', --@Maturity
0.11, --@Rate
100, --@Par
2, --@Frequency
1 --@Basis
) as BONDINT;
This produces the following result.
{"columns":[{"field":"ACCINTACT","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"BONDINT","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"ACCINTACT":"5.45479452054794","BONDINT":"5.41032608695652"}]}
The following SQL demonstrates why the 2 calculations are different.
SELECT 0.11 * 100 * CAST(DATEDIFF(d, k.prevcoup, '2014-10-29') as float) /
wct.DAYSINYEAR(k.NextCoup) as ACCINTACT,
CAST(DATEDIFF(d, k.prevcoup, '2014-10-29') as float) / CAST(DATEDIFF(d,
k.prevcoup, k.nextcoup) as float) * k.C as BONDINT
FROM wct.RPIFACTORS( '2014-10-29', --@Settlement
'2034-11-01', --@Maturity
0.11, --@Rate
100, --@Price
NULL, --@Yield
100, --@Redemption
2, --@Frequency
1 --@Basis
) k;
This produces the following result.
{"columns":[{"field":"ACCINTACT","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"BONDINT","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"ACCINTACT":"5.45479452054794","BONDINT":"5.41032608695652"}]}
See Also
ACCRINTM - Calculate the accrued interest for a security that pays interest at maturity.
BONDINT - Accrued interest on a bond paying regular, periodic interest
ODDFINT - Accrued interest for a bond with an odd first coupon
ODDLINT - Accrued interest for a bond with an odd last coupon