R
Rsosa
Hi Michael I do not know how to post a question in the newsgroup, can you
help me post this. Thanks, Robert.
Hi,
I need help making this query work. I have a query that total all student
on status X by School and By District. I am trying to limit the query to
show only the top 3 schools (school with the highest number of student in
status X) for each district. I believe that I should use a subquery within
my query using the IN statement , but it just does not work. See what I
have up to now .
SELECT DISTINCT Count([301].ID) AS COUNTOFID, [301].DIST, First([301].RPDT)
AS FIRSTOFRPDT, [301].RSSCHOOL
FROM 301
WHERE ((([301].RSSCHOOL) In (SELECT top 3 RSSCHOOL FROM 301 GROUP BY
RSSCHOOL,DIST ORDER BY Count(ID) DESC , RSSCHOOL, DIST) AND
(([301].TYPE)="NOT YET ATTENDING") AND (([301].DIST)=1)) OR
((([301].DIST)=2)) OR ((([301].DIST)=3)) OR ((([301].DIST)=4))
GROUP BY [301].DIST, [301].RSSCHOOL
ORDER BY Count([301].ID) DESC , [301].RSSCHOOL, [301].DIST;
The query is so slow that it actually freeze my computer. Can anybody help
me.
Thanks,
Bob
help me post this. Thanks, Robert.
Hi,
I need help making this query work. I have a query that total all student
on status X by School and By District. I am trying to limit the query to
show only the top 3 schools (school with the highest number of student in
status X) for each district. I believe that I should use a subquery within
my query using the IN statement , but it just does not work. See what I
have up to now .
SELECT DISTINCT Count([301].ID) AS COUNTOFID, [301].DIST, First([301].RPDT)
AS FIRSTOFRPDT, [301].RSSCHOOL
FROM 301
WHERE ((([301].RSSCHOOL) In (SELECT top 3 RSSCHOOL FROM 301 GROUP BY
RSSCHOOL,DIST ORDER BY Count(ID) DESC , RSSCHOOL, DIST) AND
(([301].TYPE)="NOT YET ATTENDING") AND (([301].DIST)=1)) OR
((([301].DIST)=2)) OR ((([301].DIST)=3)) OR ((([301].DIST)=4))
GROUP BY [301].DIST, [301].RSSCHOOL
ORDER BY Count([301].ID) DESC , [301].RSSCHOOL, [301].DIST;
The query is so slow that it actually freeze my computer. Can anybody help
me.
Thanks,
Bob