SELECT A.ASSIGNMENT_ID , A.EMPLID , A.EMPL_RCD_NUM , D.START_DT , D2.END_DT FROM PS_RS_ASSIGNMENT A , PS_RS_ASSGN_DETAIL D , PS_RS_ASSGN_DETAIL D2 , PS_RS_SO_HDR S , PS_FO_ORDER_TYPE T WHERE A.ASSIGNMENT_ID = D.ASSIGNMENT_ID AND S.BUSINESS_UNIT = A.BUSINESS_UNIT AND S.SO_ID = A.SO_ID AND A.SYSTEM_SOURCE = 'STF' AND T.USER_ORDER_TYPE = S.USER_ORDER_TYPE AND T.ORDER_TYPE = 'T' AND D.START_DT = ( SELECT MIN(START_DT) FROM PS_RS_ASSGN_DETAIL DS WHERE D.ASSIGNMENT_ID = DS.ASSIGNMENT_ID) AND A.ASSIGNMENT_ID = D2.ASSIGNMENT_ID AND D2.END_DT = ( SELECT MAX(END_DT) FROM PS_RS_ASSGN_DETAIL DE WHERE D.ASSIGNMENT_ID = DE.ASSIGNMENT_ID)
|