b1nary0mega
10/19/2015 - 1:51 PM

Update all persons to 2nd appointment that are not where HRMS says they should be. *CAUTION* - if a person is a second appointment somewher

Update all persons to 2nd appointment that are not where HRMS says they should be.

CAUTION - if a person is a second appointment somewhere that needs to be evaluated there, changing their POS_code to 2 will prevent them from being evaluated there.

/*UPDATE ALL PERSONS TO 2nd APPOINT THAT ARE NOT WHERE HRMS SAYS THEY SHOULD BE*/
UPDATE EMPLOYEE_PROFILE
SET POS_CODE = 2
/*SELECT EMPLOYEE_ID, LAST_NAME, FIRST_NAME
from EMPLOYEE_PROFILE*/
WHERE unit_id = '334'
AND EMPLOYEE_ID NOT IN
(
  SELECT EMPLOYEE_ID FROM GET_EMPL_LIST_NO_2APPT
  where dept = '500334'
)
AND (
  EMPLOYEE_ID IN ( SELECT EMPLOYEE_ID FROM GET_EMPL_LIST_NO_2APPT WHERE DEPT = '500342' )
)
AND MSS_UNIT_TERM_DT IS NULL;