Hi - I tried to word the title as accurately as possible...i know I didn't do justice. I have a little situation here. I got a table (tbl_swab) with test results for swabs namely APC and Coliform (APC_Result and coliform_Result ) done on several equipments. I am wanting to count the number of times the test failed for both APC and Coliform separately.
Failure for APC is a test result greater than or equal to 100 and for coliform, test result greater than or equal to 10.
The problem that I am running into is that the below query first selects all the APC that meets the criteria and then looks for coliform that meets it's criteria.
Is there a way to view all the APC and coliform failures separately and then be able to count them in a report.
Here is the SQL statement.
Please see the attached to have a look at the table
I appreciate any help. Thanks.
Stan
Failure for APC is a test result greater than or equal to 100 and for coliform, test result greater than or equal to 10.
The problem that I am running into is that the below query first selects all the APC that meets the criteria and then looks for coliform that meets it's criteria.
Is there a way to view all the APC and coliform failures separately and then be able to count them in a report.
Here is the SQL statement.
Code:
SELECT Tbl_swab.Type, Tbl_swab.Sample_date, Tbl_swab.Equipment, Tbl_swab.APC_Result, Tbl_swab.Coliform_Result FROM Tbl_swab GROUP BY Tbl_swab.Type, Tbl_swab.Sample_date, Tbl_swab.Equipment, Tbl_swab.APC_Result, Tbl_swab.Coliform_Result HAVING (((Tbl_swab.Type)="swab") AND ((Tbl_swab.APC_Result)>=100) AND ((Tbl_swab.Coliform_Result)>=10));
I appreciate any help. Thanks.
Stan
Comment