View Full Version : Count 2 possibilities in same query/form


cbrou
01-17-2002, 08:22 AM
I am trying to make a query or form that will display a count for the total number of tickets "open" and at the same time display the number of tickets "closed". I can do each seperately in queries using the following SQL:

SELECT Sheet1.[Client ID] AS School, Count(Sheet1.[Assigned To]) AS [Open Tickets]
FROM Sheet1
WHERE (((Sheet1.Status)="Open"))
GROUP BY Sheet1.[Client ID]
HAVING (((Count(Sheet1.[Assigned To]))>0))
ORDER BY Sheet1.[Client ID], Count(Sheet1.[Assigned To]);

Is there a way to display the results of "open" count and "closed" count in the same result?

Pat Hartman
01-17-2002, 02:30 PM
SELECT Sheet1.[Client ID] AS School, Sheet1.Status, Count(*) AS [Open Tickets]
FROM Sheet1
GROUP BY Sheet1.[Client ID], Sheet1.Status;

cbrou
01-18-2002, 05:58 AM
Pat, you are the man. I have been looking all over the net for weeks and could not put my finger on it.

Thank You!

David R
01-18-2002, 02:42 PM
Errr...actually Pat's NOT the man...but she is a great help. http://www.access-programmers.co.uk/ubb/smile.gif