Below is the code I currently have as a query. This query
works fine util: If I go into SQL mode and make any changes
at all I get an error. If I add a linefeed and take it back
out, I still get this error. If I change any character and
then change it back to exactly what it was I still get this
error:
This only happens if I hit any key of any kind. This seems
really weird that the SQL will work as long as I do not
hit any keys in SQL mode. Any advice out here? Can someone
tell me what Bracketing I should change?
works fine util: If I go into SQL mode and make any changes
at all I get an error. If I add a linefeed and take it back
out, I still get this error. If I change any character and
then change it back to exactly what it was I still get this
error:
Invalid bracketing of name 'SELECT vTbl.Day
as WUDay, Count(*) AS [WU Totals'
This only happens if I hit any key of any kind. This seems
really weird that the SQL will work as long as I do not
hit any keys in SQL mode. Any advice out here? Can someone
tell me what Bracketing I should change?
Code:
SELECT Format(TodaysDate,'yyyy-mm-dd') AS [Date], WU.[WU Totals], Count(*) AS [Leak Totals], (Count(*)/WU.[WU Totals]*1) AS [Percent]
FROM WorkUnitsFaultsMainTBL, [SELECT vTbl.Day as WUDay,
Count(*) AS [WU Totals]
FROM
(SELECT DISTINCT Format(TodaysDate,'yyyy-mm-dd') AS [Day], WorkUnit
FROM WorkUnitsFaultsMainTBL
WHERE BuildID IN ('E010','C809','F001','C810','F187','A910','M173','M174')
AND (TodaysDate BETWEEN [Forms]![Queries_ReportsFRM]![StartDateTxt]
And [Forms]![Queries_ReportsFRM]![EndDateTxt])) AS vTbl
GROUP BY vTbl.Day ]. AS WU
WHERE (((WorkUnitsFaultsMainTBL.Problem) Like "*leak*") AND ((WorkUnitsFaultsMainTBL.TodaysDate) Between [Forms]![Queries_ReportsFRM]![StartDateTxt] And [Forms]![Queries_ReportsFRM]![EndDateTxt]) AND ((WorkUnitsFaultsMainTBL.BuildID) In ("E010","C809","F001","C810","F187","A910","M173","M174")) AND ((Format([TodaysDate],'yyyy-mm-dd'))=[WU].[WUDay]))
GROUP BY Format(TodaysDate,'yyyy-mm-dd'), WU.[WU Totals]
ORDER BY Format(TodaysDate,'yyyy-mm-dd'), WU.[WU Totals], Count(*) DESC;