Query to Count and Organize Records

Zorkmid

Registered User.
Local time
Today, 16:18
Joined
Mar 3, 2009
Messages
188
Hi there,


I have a series of forms for users to enter data about isolated patients. I have two tables with a parent-child relationship. The parent table contains info about the patient (tblPatient), and the child table (tblCase) contains info about the specific visit. There are also tables that contain location names, infection types, etc.

What I am trying to build, is a query that will count all of the records that have a blank End Date field (that is, patients that are currently present) and organize the count according to location, so that a report can be given to housekeeping manager that will help him to assign his staff properly. I have a select query that gives me all of these records, But I need a way to count them by location.

-Thanks,
z
 

Attachments

Code:
SELECT tblCase.fkUnitID, Count(tblCase.fkUnitID) AS Patients
FROM tblCase
WHERE (((tblCase.EndDate) Is Null))
GROUP BY tblCase.fkUnitID;

Should do the trick
 

Users who are viewing this thread

Back
Top Bottom