- Local time
- Today, 16:09
- Joined
- Sep 28, 2010
- Messages
- 83
So, this query is dynamically built in VBA and added to a new query..
However, when attempting to run the query the = goes walkabout.. Adding double ='s into the VB does nothing other than generate errors..
Am I missing something simple?
TIA..
Code:
SELECT DISTINCT dbo_ReportData.DOCKET, dbo_ReportData.site_search, Priority_Grouping.Category, Priority_Grouping.Priority, Prod_ShortCode.ShortCode, Prod_ShortCode.HighLevelGroup, dbo_ReportData.Description, Count(dbo_ReportData.[Job No]) AS [CountOfJob No], Sum(dbo_ReportData.[Response Time]) AS [SumOfResponse Time], Sum(dbo_ReportData.[Fix Time]) AS [SumOfFix Time], Min(dbo_ReportData.[Received Date]) AS [MinOfReceived Date], Max(dbo_ReportData.[Completion Date]) AS [MaxOfCompletion Date], Last(dbo_ReportData.[Fault Desc 1]) AS [LastOfFault Desc 1], Last(dbo_ReportData.[Fault Desc 2]) AS [LastOfFault Desc 2], Last(dbo_ReportData.[Fault Desc 3]) AS [LastOfFault Desc 3], Last(dbo_ReportData.[Work Done 1]) AS [LastOfWork Done 1], Last(dbo_ReportData.[Work Done 2]) AS [LastOfWork Done 2] FROM Prod_ShortCode INNER JOIN (Priority_Grouping INNER JOIN dbo_ReportData ON Priority_Grouping.Priority = dbo_ReportData.Priority) ON Prod_ShortCode.Description = dbo_ReportData.Description WHERE (((dbo_ReportData.[Log Num])
In (1,2,3,5,6,12,24,36,99)) AND ((dbo_ReportData.[Completion Date]) BETWEEN 01/01/2011 AND 01/03/2011) AND ((dbo_ReportData.site_search)[B]=[/B]"TTTT001")) GROUP BY dbo_ReportData.DOCKET, dbo_ReportData.site_search, Priority_Grouping.Category, Priority_Grouping.Priority, Prod_ShortCode.ShortCode, Prod_ShortCode.HighLevelGroup, dbo_ReportData.Description ORDER BY Count(dbo_ReportData.[Job No]) DESC;
However, when attempting to run the query the = goes walkabout.. Adding double ='s into the VB does nothing other than generate errors..
Am I missing something simple?
TIA..