INTRATE
Updated 2023-10-06 14:27:15.823000
Syntax
SELECT [westclintech].[wct].[INTRATE] (
<@Settlement, datetime,>
,<@Maturity, datetime,>
,<@Investment, float,>
,<@Redemption, float,>
,<@Basis, nvarchar(4000),>)
Description
Use the scalar function INTRATE to calculate the interest rate for a fully invested security.
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":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"}]}
@Investment
the amount invested in the security. @Investment 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.
@Redemption
the security’s redemption value per 100 face value. @Redemption is an expression of type float or of a type that can be implicitly converted to float.
Return Type
float
Remarks
If @Redemption < 0, INTRATE returns an error.
If @Settlement > @Maturity, INTRATE returns an error.
If the @Basis < 0 or the @Basis > 4, INTRATE returns an error.
INTRATE is calculated using the following formula:
INTRATE = (@redemption-@investment)/@investment*b/DSM
Where
b = the number of days in the yearDSM = the number of days between @settlement and @maturity
Examples
SELECT wct.INTRATE('2/7/2008', '5/8/2008', 98975, 100000, 0);
Here is the result set.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"0.0409693867637793"}]}