M
MikeB
I'm constructing a simple query and depending on how I do it in the
Access design window, I get different results. The SQL for the two
queries are hereunder, I don't understand the difference between the
"HAVING" and the "WHERE" clauses. can someone please enlighten me?
Query 1:
SELECT Count(Games.IsBye) AS CountOfIsBye
FROM Games
HAVING (((Count(Games.IsBye))=Yes));
Yields a count of 232. (that is all the records in the table,
regardless of the value of the IsBye field).
Query 2:
SELECT Count(Games.IsBye) AS CountOfIsBye
FROM Games
WHERE (((Games.IsBye)=Yes));
Yields a count of 32, which is the number of games that has "Yes" in
the IsBye field.
Access design window, I get different results. The SQL for the two
queries are hereunder, I don't understand the difference between the
"HAVING" and the "WHERE" clauses. can someone please enlighten me?
Query 1:
SELECT Count(Games.IsBye) AS CountOfIsBye
FROM Games
HAVING (((Count(Games.IsBye))=Yes));
Yields a count of 232. (that is all the records in the table,
regardless of the value of the IsBye field).
Query 2:
SELECT Count(Games.IsBye) AS CountOfIsBye
FROM Games
WHERE (((Games.IsBye)=Yes));
Yields a count of 32, which is the number of games that has "Yes" in
the IsBye field.