Can you please tell me why this query will not count all of the occurences that exist in a quarter. The query counts only one occurrence of each date, ie., if there are two or more occurrences of 3/24/2009, the query only counts one occurrent vs, two or three occurences.
SQL:
SELECT [Pacer QA tbl].DateofProcedure, [Pacer QA tbl].PacerorICD, [Pacer QA tbl].NewImplantorGeneratorChange, IIf(Month([DateofProcedure]) In (10,11,12),"Quarter 1",IIf(Month([DateofProcedure]) In (1,2,3),"Quarter 2",IIf(Month([DateofProcedure]) In (4,5,6),"Quarter 3","Quarter 4"))) AS Qtr
FROM [Pacer QA tbl]
GROUP BY [Pacer QA tbl].DateofProcedure, [Pacer QA tbl].PacerorICD, [Pacer QA tbl].NewImplantorGeneratorChange, IIf(([DateofProcedure]) In (9,10,11),"Quarter 1",IIf(([DateofProcedure]) In (12,1,2),"Quarter 2",IIf(([DateofProcedure]) In (3,4,5),"Quarter 3","Quarter 4")))
HAVING ((([Pacer QA tbl].PacerorICD)="ICD") AND (([Pacer QA tbl].NewImplantorGeneratorChange)="New"))
ORDER BY [Pacer QA tbl].PacerorICD;
The attached file ICD New by Quarter qry is from the sql above.
The attached file ICD New qry is from the SQL below:
SELECT [Pacer QA tbl].DateofProcedure, [Pacer QA tbl].PacerorICD, [Pacer QA tbl].NewImplantorGeneratorChange
FROM [Pacer QA tbl]
WHERE ((([Pacer QA tbl].PacerorICD)="ICD") AND (([Pacer QA tbl].NewImplantorGeneratorChange)="New"));
SQL:
SELECT [Pacer QA tbl].DateofProcedure, [Pacer QA tbl].PacerorICD, [Pacer QA tbl].NewImplantorGeneratorChange, IIf(Month([DateofProcedure]) In (10,11,12),"Quarter 1",IIf(Month([DateofProcedure]) In (1,2,3),"Quarter 2",IIf(Month([DateofProcedure]) In (4,5,6),"Quarter 3","Quarter 4"))) AS Qtr
FROM [Pacer QA tbl]
GROUP BY [Pacer QA tbl].DateofProcedure, [Pacer QA tbl].PacerorICD, [Pacer QA tbl].NewImplantorGeneratorChange, IIf(([DateofProcedure]) In (9,10,11),"Quarter 1",IIf(([DateofProcedure]) In (12,1,2),"Quarter 2",IIf(([DateofProcedure]) In (3,4,5),"Quarter 3","Quarter 4")))
HAVING ((([Pacer QA tbl].PacerorICD)="ICD") AND (([Pacer QA tbl].NewImplantorGeneratorChange)="New"))
ORDER BY [Pacer QA tbl].PacerorICD;
The attached file ICD New by Quarter qry is from the sql above.
The attached file ICD New qry is from the SQL below:
SELECT [Pacer QA tbl].DateofProcedure, [Pacer QA tbl].PacerorICD, [Pacer QA tbl].NewImplantorGeneratorChange
FROM [Pacer QA tbl]
WHERE ((([Pacer QA tbl].PacerorICD)="ICD") AND (([Pacer QA tbl].NewImplantorGeneratorChange)="New"));