Login     Register

        Contact Us     Search

XLeratorDB/financial Documentation

SQL Server RECEIVED function


RECEIVED
 
Updated: 5 August 2010
Use RECEIVED to calculate the amount received at maturity for a fully invested security.
Syntax
SELECT [westclintech].[wct].[RECEIVED] (
   <@Settlement, datetime,>
 ,<@Maturity, datetime,>
 ,<@Investment, float,>
 ,<@Discount, float,>
 ,<@Basis, nvarchar(4000),>)
Arguments
@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. 
@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.
@Discount
the security’s discount rate. @Redemption is an expression of type float or of a type that can be implicitly converted to float.
@Basis
is the type of day count to use. @Basis is an expression of the character string data type category.
 
@Basis
Day count basis 
0 or omitted
US (NASD) 30/360
1
Actual/Actual
2
Actual/360
3
Actual/365
4
European 30/360
 
Return Type
float
Remarks
·         If @Investment <= 0 or @Discount <= 0, RECEIVED returns an error
·         If @Settlement >= @Maturity, RECEIVED returns an error
·         If @Basis < 0 or @Basis > 4, RECEIVED returns an error
·         RECEIVED performs the following calculation:
RECEIVED = @investment/(1-(@Discount*DSM/b))
Where
b = the number of days in the year depending on the year basis
DSM = the number of days from settlement to maturity
Example
 
SELECT wct.RECEIVED('2/1/2008'
,'5/2/2008'
,98975
,0.0475
,0)
Here is the result set
----------------------

100177.829634992



Copyright 2008-2024 Westclintech LLC         Privacy Policy        Terms of Service