Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VB.net SQL Error querying SQL 2008 database

Hi I am getting the error 'Ave' is not a recognized built-in function name when running the following query against
a SQL 2008 database in my vb.net project


		S	"SELECT [Performance].[Shaft], Sum([Performance].[Drilled Total]) AS Metres,[Shafts].[Target] * Count(DISTINCT [Performance].[Date]) As Target, Ave([Performance].[Drilled Total]) As [Ave M/Mach/Shift], Sum([Performance].[Delay Hours 1]) AS Delays, Sum([Performance].[DWR Hours]) AS DWR, Sum([Performance].[Standing Time]) AS [Standing Time], Sum([Performance].[Grout Hours]) AS [Grout Hours], Sum([Performance].[Concrete Redrill]) AS ReDrill, Sum([Performance].Setup) AS Setups, Sum([Performance].[Transport Hours]) as [Transport Hours], Sum([Performance].[Photographic Survey]) as [Photographic Survey], Sum([Performance].[Day Rate]) as [Day Rate], Sum([Performance].[Blank Cap]) as [Blank Cap], Sum([Performance].[Mobilise]) as [Mobilise], Sum([Performance].[Set Up Stope]) as [Set Up Stope], Sum([Performance].[Interhole Move]) as [Interhole Move], Sum([Performance].[Grouting Borehole]) as [Grouting Borehole], Sum([Performance].[Plugging]) as [Plugging], Sum([Performance].[Trp Equip UG]) as [Trp Equip UG], Cast([Shafts].[From] As Date) As [Month_Start] FROM [Performance] Inner Join [Shafts] On [Performance].[Shaft] = [Shafts].[Shaft] Where [Date] >= [Shafts].[From] And [Date] <= '07 Nov 2015' GROUP BY [Performance].Shaft,[Shafts].[From],[Shafts].[Target]"	String

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown

ASKER

Thanks