hsingh1981
Programmer
Hi all,
I'm try to show query which have staff names and there grades and show all the equipment they used. I can do that with this code:
But wat i would like to see is equipment as the column names and if they do have the equipment mark it as an "X"
eg.
staffname grade ventilator defib heartmonitor
joe blogs 5 x
andrew smith 4 x
james tee 6 x
Craig james 4 x
etc
Am not sure how to do this with sql 2000? can someone show me an example...or something
many thanks
I'm try to show query which have staff names and there grades and show all the equipment they used. I can do that with this code:
Code:
SELECT Staff.Surname + ', ' + Staff.Firstname AS StaffName, Staff.Grade, R_Equipment.Equipment
FROM R_EquipmentArea INNER JOIN
R_Equipment INNER JOIN
EquipTraining INNER JOIN
Staff ON EquipTraining.StaffID = Staff.StaffID ON R_Equipment.ID = EquipTraining.EquipID ON R_EquipmentArea.EquipID = R_Equipment.ID
GROUP BY Staff.Surname + ', ' + Staff.Firstname, Staff.Grade, R_Equipment.Equipment
But wat i would like to see is equipment as the column names and if they do have the equipment mark it as an "X"
eg.
staffname grade ventilator defib heartmonitor
joe blogs 5 x
andrew smith 4 x
james tee 6 x
Craig james 4 x
etc
Am not sure how to do this with sql 2000? can someone show me an example...or something
many thanks