So I guess I can't do this? Reference the First table functions values in the cross apply's table functions parameters (A.agr_active_days)? I read a thread about the compatibility level of my database and how upgrading from 80 to 90 might allow me to execute this query, but since I am using a linked server I don't have that option. Any other ideas or a better way of doing this? Function dbo.GetAllAgreementAmounts returns all active agreements for a company and how much they are charged daily. Also returns the value in question agr_active_days, which I need is the number of days the agreement was active in a date range. Function dbo.xf_TableNumberRange returns a basic table with number values.I receive the following error: Msg 102, Level 15, State 1, Line 21Incorrect syntax near 'A'.Declare @start_date datetime, @end_date datetimeSET @start_date = '6/1/2009'SET @end_date = '6/30/2009'SELECT B.[Date], MONTH(B.[Date]) AS [Month], YEAR(B.Date) AS [Year], A.[agr_amount_daily], A.[company]FROM dbo.GetAllAgreementAmounts(@start_date, @end_date) AS ACROSS APPLY(SELECT [Date] = dateadd(dd,number-1, A.agr_active_date_start)-- Value that is giving the issue below A.agr_active_daysFROM dbo.xf_TableNumberRange(1, A.agr_active_days)) AS B