Hi bperry,
Sorry for all this hassel, well yes i am working on Ms Access, and yet (cast) is not working and the message that the program is returning is as follows:
Syntax error ( missing operator) in queri expression
"CAST (
(Select count(Ward_code) FROM Admission
WHERE admission.Ward_code = ward.Ward_code
AND admission.Discharge_date IS NULL
) AS numeric(3,2)) / bed_count *100 ".
So what do u thing is the problem
1st thread
Hi,
How can i produce a report that gives for each ward its name, code, and the percentage occupied in the ward of a hospital.
Knowing that we have the table of "Ward" which hold a wardCode, wardName, BedCount.
And another table for Admission which has AdmissionID, patient_Id, AdmissionDate, Ward code Discharge_Date
Thanks for all your help
Dado
2nd thread
Hi,
Thanks for ur solutions i was trying to work on this one below but it is still not working. And to tell u the truth i haven't heard of the "CAST" before maybe it is replacment for some other word so if it is tell me what is it please check the code and tell me what u think
Thanks allot
Dado
N.B: if u need i can send u the Data base
SELECT ward.Ward_code,ward.Ward_name,
CAST (
(Select count(Ward_code) FROM Admission
WHERE admission.Ward_code = ward.Ward_code
AND admission.Discharge_date IS NULL
) AS numeric(3,2)) / bed_count *100 AS PerOcc
FROM Ward
INNER JOIN Admission
ON ward.Ward_code = admission.Ward_code
Group By ward.Ward_code, ward.ward_name, ward.Bed_count;