Logo

SQL Server XIRR2005 Function

Updated: 10 September 2010

Description

Use scalar function XIRR2005 for legacy implementations prior to SQL Server 2008. This function is for campatability purposes only.

Syntax

SELECT [wct].[XIRR2005] (
   <@CashFlows_TableName, nvarchar(max),>
  ,<@CashFlows_ColumnName, nvarchar(4000),>
  ,<@CashFlows_GroupedColumnName, nvarchar(4000),>
  ,<@CashFlows_GroupedColumnValue, sql_variant,>
  ,<@CashFlowDates_ColumnName, nvarchar(4000),>
  ,<@Guess, float,>)

Arguments

@CashFlows_TableName

the name, as text, of the table or view which contains the cash flow values to be used in the internal rate of return calculation.

@CashFlows_ColumnName

the name, as text, of the column in table which contains the cash flow value to be used in the internal rate of return calculation.

@CashFlows_GroupedColumnName

the name, as text, of the column in the table which contains the cash flows to group the results on.

@CashFlows_GroupedColumnValue

the column value to do the grouping on.

@CashFlowDates_ColumnName

the name of column in the @CashFlows_Table Name to which contains the date values to be used in the IRR calculation. The column values must evaluate to datetime.

@Guess

the user-supplied initial guess used in the first iteration of the internal rate of return calculation. @Guess is an expression of type float or of a type that can be implicitly converted to float or is NULL.

Return Type

float

Remarks

For more information see the XIRR aggregate funcion