SELECT P.BUSINESS_UNIT , P.PROJECT_ID , P.ACTIVITY_ID , P.POOL_ID , G.EMPLID , G.START_DATE , G.END_DATE , ACT.START_DT , ACT.END_DT FROM %Table(PGM_ACT_POOL) P , %Table(RS_MEMBER_GRID) G , %Table(PROJECT) PR , %Table(PROJ_ACTIVITY) ACT WHERE P.BUSINESS_UNIT = PR.BUSINESS_UNIT AND P.PROJECT_ID = PR.PROJECT_ID AND P.BUSINESS_UNIT = ACT.BUSINESS_UNIT AND P.PROJECT_ID = ACT.PROJECT_ID AND P.ACTIVITY_ID = ACT.ACTIVITY_ID AND P.POOL_ID = G.POOL_ID AND PR.ENFORCE_TYPE = 'S' AND PR.SUMMARY_PRJ = 'N' AND PR.EFF_STATUS = 'A' AND ACT.EFF_STATUS = 'A' AND ACT.COSTING_ACT_SW = 'Y' AND (G.START_DATE BETWEEN ACT.START_DT AND ACT.END_DT OR G.END_DATE BETWEEN ACT.START_DT AND ACT.END_DT OR (G.START_DATE < ACT.START_DT AND G.END_DATE IS NULL) OR (G.START_DATE < ACT.START_DT AND G.END_DATE > ACT.END_DT))
|