SELECT [Performance].[Date] As [Date],[Performance].[Shaft], Sum([Performance].[Drilled Total]) AS Metres,[vShafts_StartDate].[Target] * Count(DISTINCT [Performance].[Date]) As Target, Avg([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([vShafts_StartDate].[StartDate] As Date) As [Month_Start], [vShafts_StartDate].[Target] as newTarget
FROM [Performance] Inner Join [vShafts_StartDate] On [Performance].[Shaft] = [vShafts_StartDate].[Shaft]
Where [Date] >= [vShafts_StartDate].[StartDate] And [Date] <= '11 Mar 2016'And [Performance].[Shaft] = 'kopanang air'
GROUP BY [Performance].[Date],[Performance].Shaft,[vShafts_StartDate].[StartDate],[vShafts_StartDate].[Target]
ASKER
ASKER
Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.
TRUSTED BY
Open in new window