GPCH_AL_LHIR_VW

(SQL View)
Index Back

Latest Hire View

Latest Hire View

SELECT EMPLID ,EMPL_RCD ,EFFDT ,ACTION ,COMPANY ,PAY_SYSTEM_FLG FROM PS_JOB J1 WHERE J1.PER_ORG = 'EMP' AND J1.PAY_SYSTEM_FLG = 'GP' AND (( J1.ACTION IN ('HIR','REH','ADL') AND NOT EXISTS ( SELECT 'x' FROM PS_JOB J2 WHERE J1.PER_ORG = J2.PER_ORG AND J1.PAY_SYSTEM_FLG = J2.PAY_SYSTEM_FLG AND J1.EMPLID = J2.EMPLID AND J1.EMPL_RCD <> J2.EMPL_RCD AND J1.COMPANY = J2.COMPANY AND J2.EFFDT = ( SELECT MAX(J3.EFFDT) FROM PS_JOB J3 WHERE J2.EMPLID = J3.EMPLID AND J2.PER_ORG = J3.PER_ORG AND J2.PAY_SYSTEM_FLG = J3.PAY_SYSTEM_FLG AND J2.EMPL_RCD = J3.EMPL_RCD AND J2.COMPANY = J3.COMPANY AND J3.EFFDT < J1.EFFDT ) AND J2.ACTION <> 'TER' ) ) OR ( J1.ACTION = 'TER' AND J1.PER_ORG = 'EMP' AND NOT EXISTS ( SELECT 'x' FROM PS_JOB J4 WHERE J1.EMPLID = J4.EMPLID AND J1.EMPL_RCD <> J4.EMPL_RCD AND J1.PER_ORG = J4.PER_ORG AND J1.PAY_SYSTEM_FLG = J4.PAY_SYSTEM_FLG AND J1.COMPANY = J4.COMPANY AND J4.EFFDT = ( SELECT MAX(J5.EFFDT) FROM PS_JOB J5 WHERE J4.EMPLID = J5.EMPLID AND J4.EMPL_RCD = J5.EMPL_RCD AND J4.PER_ORG = J5.PER_ORG AND J4.PAY_SYSTEM_FLG = J5.PAY_SYSTEM_FLG AND J4.COMPANY = J5.COMPANY AND J5.EFFDT <= J1.EFFDT ) AND J4.EMPL_STATUS = 'A' ) ) )

# PeopleSoft Field Name PeopleSoft Field Type Database Column Type Description
1 EMPLID Character(11) VARCHAR2(11) NOT NULL Employee ID
2 EMPL_RCD Number(3,0) SMALLINT NOT NULL Empl Rcd Nbr
3 EFFDT Date(10) DATE Effective Date

Default Value: %date

4 ACTION Character(3) VARCHAR2(3) NOT NULL Action

Prompt Table: ACTION_TBL

5 COMPANY Character(3) VARCHAR2(3) NOT NULL Company
6 PAY_SYSTEM_FLG Character(2) VARCHAR2(2) NOT NULL Payroll System
GP=Global Payroll
NA=Payroll for North America
OT=Other
PI=Payroll Interface