proper use of where statement with count and group by.

MilaK

Registered User.
Local time
Today, 05:24
Joined
Feb 9, 2015
Messages
285
Please help fix the following query so the criteria is applied. Currently, the criteria is not working.

Code:
SELECT tbl_Projects.run_type, Count(tbl_Samples.sample_id) AS exp
FROM tbl_Projects INNER JOIN tbl_Samples ON tbl_Projects.run_name = tbl_Samples.run_name
GROUP BY tbl_Projects.run_type
HAVING (((Count(tbl_Samples.sample_id)) Not Like "*HD753*"));

Thanks
 
I very much doubt a count of anything is going to be like *HD753* .

Try
Code:
SELECT tbl_Projects.run_type, Count(tbl_Samples.sample_id) AS exp
FROM tbl_Projects INNER JOIN tbl_Samples ON tbl_Projects.run_name = tbl_Samples.run_name
WHERE (tbl_Samples.sample_id) Not Like "*HD753*"))
GROUP BY tbl_Projects.run_type
 
I removed the two extra )) and it worked great. Thanks
 

Users who are viewing this thread

Back
Top Bottom