Use the scalar-valued function AIFACTOR_IAM to calculate the Accrued Interest Factor for an Interest-at-Maturity security. AIFACTOR_IAM returns a decimal value which can then be multiplied by the face amount of the bond to return the monetary value of the accrued interest.

Syntax

SELECT [wctFinancial].[wct].[AIFACTOR_IAM] (

<@Basis,nvarchar(4000),>

,<@Rate,float,>

,<@IssueDate,datetime,>

,<@Settlement,datetime,>

,<@Maturity,datetime,>

,<@Holidays,nvarchar(max),>)

Arguments

@Basis

the day-count convention used in the calculation of the accrued coupon interest. @Basis is an expression of the character string data type category.

@Basis

Day count basis

0 or omitted

US (NASD) 30/360

2

Actual/360

3

Actual/365

4

European 30/360

5

30/360 ISDA

7

NL/365

8

NL/360

9

A/364

10

US (NASD) 30/360 non-end-of-month

12

Actual/360 non-end-of-month

13

Actual/365 non-end-of-month

14

European 30/360 non-end-of-month

15

30/360 ISDA non-end-of-month

17

NL/365 non-end-of-month

18

NL/360 non-end-of-month

19

A/364 non-end-of-month

@Rate

the coupon rate, as a decimal, for the financial instrument. @Rate is an expression of type float or of a type that can be implicitly converted to float.

@IssueDate

the first interest accrual date for the security. @IssueDate is an expression of type datetime or of a type that can be implicitly converted to datetime.

@Settlement

the settlement date of the transaction. @Settlement is an expression of type datetime or of a type that can be implicitly converted to datetime.

@Maturity

the maturity date for the financial instrument. @Maturity is an expression of type datetime or of a type that can be implicitly converted to datetime.

@Holidays

a comma separated string containing the holiday (non-business) dates to be used in the calculation of the number of business days. You can use the aggregate function NDB to create an appropriately formatted string.

Return Type

float

Remarks

·For more information on accrual calculations, go to AIFACTOR.

·@Settlement must be greater than or equal to @IssueDate and less than or equal to @Maturity.

Examples

This is a bond issued on 01-Mar-2012, settling on 21-May-2012 with a maturity date of 01-Jul-2012. The bond has an interest rate of 0.50% and interest is calculated using the Actual / 360 day-count convention.

SELECT wct.AIFACTOR_IAM(

2 --Basis

,.005 --Rate

,'2012-03-01'--Issue Date

,'2012-05-21'--Settlement

,'2012-07-01'--Maturity

,NULL--Holidays

)as [Accrued Interest]

This produces the following result.

Accrued Interest

----------------------

0.001125

If we had purchased 100,000,000 face amount of the previous bond, the monetary value of the accrued interest would be:

SELECT wct.AIFACTOR_IAM(

2 --Basis

,.005 --Rate

,'2012-03-01'--Issue Date

,'2012-05-21'--Settlement

,'2012-07-01'--Maturity

,NULL--Holidays

)* 100000000 as [Accrued Interest]

This produces the following result.

Accrued Interest

----------------------

112500

Here we look at the same bound across a variety of day count conventions.