S
shep
I have reviewed responses to several similar postings, particularly thoase by
Ofer (7/28/05), Gerald Stanley (7/15/05), and Ken Snell (6/12/05). However,
I have not been able to solve my need.
I have a table tblStatusHistoryV1 that stores patients change in status by
date. They are initially "Active" and may subsequently change to "Inactive",
back to "Active", or "Discharged".
Here is SQL for qryActivePatientsV2
SELECT tblStatusV1.Status, Count(tblStatusHistoryV1.ChartNumber) AS
CountOfChartNumber
FROM tblStatusV1, tblStatusHistoryV1 INNER JOIN qryPatientNameV1 ON
tblStatusHistoryV1.ID = qryPatientNameV1.ID
GROUP BY tblStatusV1.Status
HAVING (((tblStatusV1.Status)="Active"));
But this counts all records in tblStatusHistoryV1 that ever had a Status of
"Active". I need to count those records that have their latest status date =
"Active".
Thanks for any help
Ofer (7/28/05), Gerald Stanley (7/15/05), and Ken Snell (6/12/05). However,
I have not been able to solve my need.
I have a table tblStatusHistoryV1 that stores patients change in status by
date. They are initially "Active" and may subsequently change to "Inactive",
back to "Active", or "Discharged".
Here is SQL for qryActivePatientsV2
SELECT tblStatusV1.Status, Count(tblStatusHistoryV1.ChartNumber) AS
CountOfChartNumber
FROM tblStatusV1, tblStatusHistoryV1 INNER JOIN qryPatientNameV1 ON
tblStatusHistoryV1.ID = qryPatientNameV1.ID
GROUP BY tblStatusV1.Status
HAVING (((tblStatusV1.Status)="Active"));
But this counts all records in tblStatusHistoryV1 that ever had a Status of
"Active". I need to count those records that have their latest status date =
"Active".
Thanks for any help