Is the first function available in sql server 2005?
I am gettin the following error:
Msg 195, Level 15, State 10, Line 7
'FIRST' is not a recognized built-in function name.
Here is the query:
Select CONVERT(VARCHAR(12), FactPanelHistoryAll.FinalSimulatorReadTime,101) As Date,
AVG (FactPanelHistoryAll.EfficiencyTotal) As AverageEfficiency,
STDEV (EfficiencyTotal) As StDev,
--AVG (FactPanelHistoryAll.EfficiencyTotal)- STDEV (FactHistoryAll.EfficiencyTotal) as Var1,
--AVG (FactPanelHistoryAll.EfficiencyTotal)+ STDEV (FactHistoryAll.EfficiencyTotal) as Var2,
Count(SubID) as Volume,
--First (#tempEfficiencyTarget.EfficiencyTarget) As EfficiencyTarget,
--FIRST(#tempEfficiencyTarget.VolumeTarget) As VolumeTarget
From FactPanelHistoryAll, DimTime, #tempEfficiencyTarget
Where FactPanelHistoryAll.[FillFactor] > 0 And FactPanelHistoryAll.[FillFactor] <100
And FactPanelHistoryAll.Isc > 1
And Convert(VARCHAR(12), FactPanelHistoryAll.FinalSimulatorReadTime, 102) >= '2007.01.01' AND Convert(VARCHAR(12), FactPanelHistoryAll.FinalSimulatorReadTime, 102) <= '2008.01.01'
And Convert(VARCHAR(12), FactPanelHistoryAll.FinalSimulatorReadTime, 102) = Convert (VARCHAR(12), DimTime.CalendarDate,102)
And DimTime.Fiscalyear = #tempEfficiencyTarget.FiscalYear
And DimTime.FiscalMonth = #tempEfficiencyTarget.FiscalMonth
GROUP BY CONVERT(VARCHAR(12), FactPanelHistoryAll.FinalSimulatorReadTime,101)
Order By Date
I am gettin the following error:
Msg 195, Level 15, State 10, Line 7
'FIRST' is not a recognized built-in function name.
Here is the query:
Select CONVERT(VARCHAR(12), FactPanelHistoryAll.FinalSimulatorReadTime,101) As Date,
AVG (FactPanelHistoryAll.EfficiencyTotal) As AverageEfficiency,
STDEV (EfficiencyTotal) As StDev,
--AVG (FactPanelHistoryAll.EfficiencyTotal)- STDEV (FactHistoryAll.EfficiencyTotal) as Var1,
--AVG (FactPanelHistoryAll.EfficiencyTotal)+ STDEV (FactHistoryAll.EfficiencyTotal) as Var2,
Count(SubID) as Volume,
--First (#tempEfficiencyTarget.EfficiencyTarget) As EfficiencyTarget,
--FIRST(#tempEfficiencyTarget.VolumeTarget) As VolumeTarget
From FactPanelHistoryAll, DimTime, #tempEfficiencyTarget
Where FactPanelHistoryAll.[FillFactor] > 0 And FactPanelHistoryAll.[FillFactor] <100
And FactPanelHistoryAll.Isc > 1
And Convert(VARCHAR(12), FactPanelHistoryAll.FinalSimulatorReadTime, 102) >= '2007.01.01' AND Convert(VARCHAR(12), FactPanelHistoryAll.FinalSimulatorReadTime, 102) <= '2008.01.01'
And Convert(VARCHAR(12), FactPanelHistoryAll.FinalSimulatorReadTime, 102) = Convert (VARCHAR(12), DimTime.CalendarDate,102)
And DimTime.Fiscalyear = #tempEfficiencyTarget.FiscalYear
And DimTime.FiscalMonth = #tempEfficiencyTarget.FiscalMonth
GROUP BY CONVERT(VARCHAR(12), FactPanelHistoryAll.FinalSimulatorReadTime,101)
Order By Date