I am having some problems with syntax in a couple of queries with multiple conditions (they are being created in VBA):
Code:
strReportMachineSQL3 = "SELECT TBSource as Source, COUNT (TBSource) as qty INTO ChartTable FROM TurnBacks WHERE TBDate BETWEEN DateAdd('d', -30,Date()) AND Date() AND TBSource = '1' GROUP BY TBSource DESC;"
strReportMachineSQL4 = "SELECT RRCAAera as Source, COUNT (RRCAArea) as qty INTO ChartTable2 FORM RCAData1 WHERE DefectDate Between DateAdd('d', -30, Date()) and Date() AND RRCAArea = '1' AND RRCAType = '1' GROUP BY RRCAArea DESC;"
Do I need to do something different with all of the AND's? I think that I might be really close, but maybe a second set of eyes will help.
Also, I am completely lost on one query. I will describe what I am trying to do.
I need the list of the "Issues" for the "WorkArea" having the most "Issues" within the last 30 days and how many times each "Issue" occurs.
I hope that this makes sense. Any help would be greatly appreciated.