b1nary0mega
5/4/2015 - 3:36 PM

Get all persons and their certifications that have not expired since Jan-01 of last year

Get all persons and their certifications that have not expired since Jan-01 of last year

SELECT p.DEPT       AS DEPT,
  d.COMMON_NAME     AS NAME,
  d.SERVICE         AS SERVICE,
  p.UNIT_ID         AS UNIT_ID,
  p.EMPLOYEE_ID     AS EMPLOYEE_ID,
  p.LAST_NAME       AS LAST_NAME,
  p.FIRST_NAME      AS FIRST_NAME,
  p.POS_CODE        AS POS_CODE,
  p.TITLE           AS TITLE,
  P.MIN_WKLY_HRS/40 AS FTE,
  E.CERTIFICATION AS CERTIFICATION,
  E.CERT_TITLE AS CERT_TITLE,
  E.EXP_DATE AS EXPIRATION,
  E.FACILITY
FROM MAGNET_PROFILES_HH P
LEFT JOIN MAGNET_DIF_UNITS_HH D
ON D.HRMS_DEPT = P.DEPT
LEFT JOIN IER_CERTIFICATIONS E
ON E.EMPLOYEE_ID = P.EMPLOYEE_ID
AND E.EXP_DATE  >= '01-JAN-14'
AND E.FACILITY   = 'HH'
ORDER BY E.FACILITY,
  E.CERTIFICATION,
  E.CERT_TITLE,
  E.CERT_BODY,
  P.POS_CODE,
  P.LAST_NAME,
  P.FIRST_NAME;