ACCRINT
Updated 2023-10-06 11:45:14.720000
Syntax
SELECT [westclintech].[wct].[ACCRINT] (
<@Issue, datetime,>
,<@First_interest, datetime,>
,<@Settlement, datetime,>
,<@Rate, float,>
,<@Par, float,>
,<@Frequency, float,>
,<@Basis, nvarchar(4000),>
,<@Calc_method, bit,>);
Description
Use the scalar function ACCRINT to calculate the accrued interest for a security that pays periodic interest.
Arguments
@Calc_method
@Calc_method is a logical value that specifies the way to calculate the total accrued interest when the date of settlement is later than the date of first interest. A value of TRUE() returns the total accrued interest from issue to settlement. A value of FALSE() returns the accrued interest from first_interest to settlement. If @Calc_method is NULL it defaults to TRUE(). @Calc_method is an expression of type bit or of a type that can be implicitly converted to bit.
@Basis
is the type of day count to use. @Basis is an expression of the character string data type category.
{"columns":[{"field":"Basis","width":139},{"field":"Day count basis","width":174}],"rows":[{"Basis":"0 or omitted","Day count basis":"US (NASD) 30/360"},{"Basis":"1","Day count basis":"Actual/Actual"},{"Basis":"2","Day count basis":"Actual/360"},{"Basis":"3","Day count basis":"Actual/365"},{"Basis":"4","Day count basis":"European 30/360"}]}
@Frequency
the number of coupon payments per year. For annual payments, @Frequency = 1; for semi-annual, @Frequency = 2; for quarterly, @Frequency = 4; for monthly, @Frequency = 12. @Frequency is an expression of type float or of a type that can be implicitly converted to float.
@Rate
the coupon rate of the security expressed in decimal terms. @Rate is an expression of type float or of a type that can be implicitly converted to float.
@First_interest
the first interest payment date of the security. @First_interest is an expression that returns a datetime or smalldatetime value, or a character string in date format.
@Issue
the issue date of the security. @Issue is an expression that returns a datetime or smalldatetime value, or a character string in date format.
@Par
the par value of the security. @Par is an expression of type float or of a type that can be implicitly converted to float.
@Settlement
the settlement date occurring within the coupon period of the security. @Settlement is an expression that returns a datetime or smalldatetime value, or a character string in date format.
Return Type
float
Remarks
If @Frequency is any number other than 1, 2, 4 or 12, ACCRINT returns an error.
If @Basis < 0 or @Basis > 4, ACCRINT returns an error.
Examples
SELECT wct.ACCRINT('03/01/2008'
,'08/31/2008'
,'03/03/2008'
,0.1
,1000
,2
,0
,0);
Here is the result set
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"0.555555555555556"}]}
See Also
ACCRINTM - Calculate the accrued interest for a security that pays interest at maturity.
ODDFINT - Accrued interest for a bond with an odd first coupon
ODDLINT - Accrued interest for a bond with an odd last coupon
BONDINT - Accrued interest on a bond paying regular, periodic interest
AIFACTOR - Calculate the Accrued Interest Factor
AIFACTOR_IAM - Calculate the Accrued Interest Factor for an Interest-at-Maturity security
AIFACTOR_OFC - Calculate the Accrued Interest Factor for a bond during its odd first coupon period
AIFACTOR_OLC - Calculate the Accrued Interest Factor for a bond during its odd last coupon period
BONDAMORT - Bond amortization schedule using constant effective daily interest method