TL_RPTD_APP_VW

(SQL View)
Index Back

Latest Aprver for a time entry

View used in pivot grids to show the latest approver for a given time entry.

SELECT X.EMPLID , X.EMPL_RCD , X.DUR , X.SEQ_NBR , X.PUNCH_TYPE , U.OPRID , ( SELECT N.NAME FROM PSOPRDEFN O , PS_NAMES N WHERE O.OPRID = U.OPRID AND N.EMPLID = O.EMPLID AND N.NAME_TYPE = 'PRI' AND N.effdt = ( SELECT MAX(N1.effdt) FROM PS_NAMES N1 WHERE N1.EMPLID = N.EMPLID AND N1.NAME_TYPE = N.NAME_TYPE AND N1.effdt <= %CurrentDateIn)) FROM PS_TL_APP_RPTD_XRF X , PS_EOAW_STEPINST S , PS_EOAW_USERINST U WHERE X.EOAWTHREAD_ID = S.EOAWTHREAD_ID AND X.EOAWPRCS_ID = S.EOAWPRCS_ID AND S.EOAWSTEP_INSTANCE = U.EOAWSTEP_INSTANCE AND X.TRANSACTIONID = ( SELECT MAX(TRANSACTIONID) FROM PS_TL_APP_RPTD_XRF SUB WHERE SUB.EMPLID=X.EMPLID AND SUB.EMPL_RCD=X.EMPL_RCD AND SUB.DUR=X.DUR AND SUB.SEQ_NBR=X.SEQ_NBR AND SUB.PUNCH_TYPE=X.PUNCH_TYPE) AND X.EOAWTHREAD_ID = ( SELECT MAX(EOAWTHREAD_ID) FROM PS_TL_APP_RPTD_XRF SUB WHERE SUB.EMPLID=X.EMPLID AND SUB.EMPL_RCD=X.EMPL_RCD AND SUB.DUR=X.DUR AND SUB.SEQ_NBR=X.SEQ_NBR AND SUB.PUNCH_TYPE=X.PUNCH_TYPE AND SUB.TRANSACTIONID = X.TRANSACTIONID)

# 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 Record
3 DUR Date(10) DATE Date Under Report associates time being reported, scheduled or paid, to a specific date.
4 SEQ_NBR Number(15,0) DECIMAL(15) NOT NULL Sequence Number
5 PUNCH_TYPE Character(2) VARCHAR2(2) NOT NULL Global Punch Types
0=Elapsed
1=In
2=Out
3=Meal
4=Break
5=Transfer
6 ORIGINATORID Character(30) VARCHAR2(30) NOT NULL Originator Identifier
7 APPROVER_NAME Character(50) VARCHAR2(50) NOT NULL Approver Name