Query Problem

D

Diana

I am having a problem with the below query.
If I remove one of the fields from WHERE (run query by
either month or model) it works. Using AND, I receive zero
records with no error messages. Any ideas why? Thank you
in advance.

SELECT MainTable.Model, MainTable.Hardware, COUNT
(MainTable.Hardware) AS CountOfHardware
FROM MainTable
WHERE (((MainTable.Month)='June 2004') AND
((MainTable.Model)='D600'))
GROUP BY MainTable.Model, MainTable.Hardware;
 
D

Douglas J. Steele

You know that there are records for June, 2004, and you know that there are
records for D600, but do you know that there are, in fact, records for that
combination?
 
D

Diana

Yes, several.
Thanks.
-----Original Message-----
You know that there are records for June, 2004, and you know that there are
records for D600, but do you know that there are, in fact, records for that
combination?


--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)





.
 
D

Douglas J. Steele

The only thing I can think of is to try the following, but I don't
understand why the original query doesn't work:

SELECT MainTable.Model, MainTable.Hardware, COUNT
(MainTable.Hardware) AS CountOfHardware
FROM MainTable
GROUP BY MainTable.Model, MainTable.Hardware;
HAVING (((MainTable.Month)='June 2004') AND
((MainTable.Model)='D600'))
 
Top