SELECT DISTINCT
staffMember.staffNumber,
staffMember.lastName,
staffMember.firstName,
staffMember.title,
staffMember.departmentName,
staffMember.schoolName,
staffMember.schoolID,
RIGHT(sif_StaffPersonal.workPhone, 5) AS Ext,
sif_StaffPersonal.email,
staffMember.endDate,
CustomStudent.value
FROM staffMember
INNER JOIN sif_StaffPersonal ON staffMember.personID = sif_StaffPersonal.personID
LEFT OUTER JOIN CustomStudent ON CustomStudent.personID = sif_StaffPersonal.personID AND CustomStudent.attributeID = 365
WHERE ( staffMember.endDate IS NULL )
ORDER BY staffMember.lastName
|