SELECT a.emplid ,a.empl_rcd ,a.gpgb_co_ord_ref , x.xlatlongname ,CASE WHEN a.gpgb_co_leg = 'EW' THEN ( SELECT descr FROM ps_gpgb_co_ew_tbl WHERE gpgb_co_order=a.gpgb_co_order) WHEN a.gpgb_co_leg = 'NI' THEN ( SELECT descr FROM ps_gpgb_co_ni_tbl WHERE gpgb_co_order=a.gpgb_co_order) WHEN a.gpgb_co_leg = 'SC' THEN ( SELECT descr FROM ps_gpgb_co_SC_tbl WHERE gpgb_co_order=a.gpgb_co_order) END AS descr,a.start_date, CASE WHEN a.GPGB_CO_AMT_PAYBLE = 0 THEN a.gpgb_co_ndr ELSE a.GPGB_CO_AMT_PAYBLE END ,E1.jobcode_descr FROM ps_gpgb_ee_co_Dtl a,psxlatitem x ,PS_JOB_CURR_VW1 E1 WHERE x.fieldname='GPGB_CO_LEG' AND x.fieldvalue=a.gpgb_co_leg AND active_flag='A' AND E1.emplid=a.emplid AND E1.empl_Rcd = a.empl_Rcd
|