SELECT O.ROLEUSER ,W.BUSINESS_UNIT ,T.TIME_SHEET_ID ,P.NAME ,T.PERIOD_END_DT ,SUM(L.SP_TIME_QTY) ,D.CURRENCY_CD FROM PS_SPF_WORDERREC W , PS_SPA_TIME_HDR T , PS_SPA_TIME_DTL D , PS_SPA_TIM_DTL_DLY L , PS_SPB_PERSON_TBL P , PS_ROLEXLATOPR O WHERE W.BUSINESS_UNIT = T.BUSINESS_UNIT AND D.BUSINESS_UNIT = T.BUSINESS_UNIT AND W.WORK_ORDER_ID = D.WORK_ORDER_ID AND T.TIME_SHEET_ID = D.TIME_SHEET_ID AND D.TIME_SHEET_ID = L.TIME_SHEET_ID AND D.LINE_NBR = L.LINE_NBR AND T.PERSON_ID = P.PERSON_ID AND D.TIME_LINE_STATUS = 'SUB' AND (O.ROLEUSER IN ( SELECT C.OPRID FROM PS_SPA_TS_APR_XREF A , PS_EOAW_STEPINST B , PS_EOAW_USERINST C WHERE A.EOAWDEFN_ID = B.EOAWDEFN_ID AND A.EOAWPRCS_ID = B.EOAWPRCS_ID AND A.EOAWTHREAD_ID = B.EOAWTHREAD_ID AND B.EOAWSTEP_INSTANCE = C.EOAWSTEP_INSTANCE AND A.BUSINESS_UNIT = T.BUSINESS_UNIT AND A.TIME_SHEET_ID = T.TIME_SHEET_ID AND B.EOAWSTEP_STATUS <> 'A')) GROUP BY O.ROLEUSER ,W.BUSINESS_UNIT ,T.TIME_SHEET_ID ,P.NAME ,T.PERIOD_END_DT ,D.CURRENCY_CD
|