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 alot
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;
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 alot
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;