SELECT DeptByArea.School, ActiveStatementDetails.[Department Description], Sum(IIf([Current SoE]="y",1,0)) AS YesCount, ActiveStatementDetails.[Employment Term Description]
FROM ActiveStatementDetails INNER JOIN (SOEYCount INNER JOIN DeptByArea ON SOEYCount.[Department Description] = DeptByArea.[Department Description]) ON ActiveStatementDetails.[Department Description] = SOEYCount.[Department Description]
WHERE NOT (ActiveStatementDetails.[Employment Term Description] in (
'fixed term - 1 months',
'fixed term - 2 months',
'fixed term - 3 months',
'fixed term - 4 months',
'fixed term - 5 months',
'fixed term - 6 months',
'fixed term - 7 months',
'fixed term - 8 months',
'fixed term - 9 months',
'fixed term - 10 months',
'fixed term - 11 months'))
AND NOT (ActiveStatementDetails.[Employment Term Description] LIKE 'Standard -*')
GROUP BY DeptByArea.School, ActiveStatementDetails.[Department Description], ActiveStatementDetails.[Employment Term Description];
|