Query Question-Critiera

C

Chey

I have a query with the following fields
Vendor Number-
CountOfMonths: (SELECT COUNT(*)
TheMonth2
ZEZA

And this is my SQLSELECT T1.[Vendor Number], (SELECT COUNT(*)
FROM [tblGrantCompletion] AS T2
WHERE T2.[Vendor Number] = T1.[Vendor Number]
AND T2.[ZEZA] = TRUE) AS CountOfMonths, T1.TheMonth2
FROM tblGrantCompletion AS T1
WHERE (((T1.TheMonth2) Is Not Null) AND ((T1.ZEZA)=True)) OR
(((T1.TheMonth2) Between #7/1/2006# And #11/1/2006#)) OR ((((SELECT COUNT(*)
FROM [tblGrantCompletion] AS T2
WHERE T2.[Vendor Number] = T1.[Vendor Number]
AND T2.[ZEZA] = TRUE))>=6))
ORDER BY T1.[Vendor Number], T1.TheMonth2;

What I am looking for is the vendor number with the months below but only if
there are more than 6 months. So if that vendor number has more than six
ZEZA then I want to know.
I have the look of the result I want but it still shows me even in a Vendor
number only has 2 months associated with it. ZEZA and TheMonths2 go hand in
hand. The report result I am looking for is how many providers have had ZEZA
and the months in which they had them.
I hope someone can help me.
Thanks
Chey
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top