SELECT BU.BUSINESS_UNIT , VJUR.SETID , VJUR.VENDOR_ID , VJUR.VNDR_LOC , VJUR.WTHD_ENTITY , VJUR.WTHD_TYPE , VJUR.WTHD_JUR_CD , VJUR.DEFAULT_CLASS FROM PS_WTHD_BU_JUR BU , PS_VENDOR_WTHD_JUR VJUR , PS_VENDOR VNDR WHERE BU.EFFDT = ( SELECT MAX(B.EFFDT) FROM PS_WTHD_BU_HDR B WHERE B.BUSINESS_UNIT = BU.BUSINESS_UNIT AND B.EFFDT <= %CurrentDateIn AND B.EFF_STATUS = 'A') AND BU.COLLECT_AGENT_FLG = 'Y' AND VJUR.EFFDT = ( SELECT MAX(V.EFFDT) FROM PS_VENDOR_LOC V WHERE V.SETID = VJUR.SETID AND V.VENDOR_ID = VJUR.VENDOR_ID AND V.VNDR_LOC = VJUR.VNDR_LOC AND V.EFFDT <= %CurrentDateIn AND V.EFF_STATUS = 'A') AND VJUR.WTHD_ENTITY = BU.WTHD_ENTITY AND VJUR.WTHD_TYPE = BU.WTHD_TYPE AND VJUR.WTHD_JUR_CD = BU.WTHD_JUR_CD AND VJUR.DEFAULT_JUR_FLG = 'Y' AND VJUR.WTHD_FLG = 'Y' AND VNDR.SETID = VJUR.SETID AND VNDR.VENDOR_ID = VJUR.VENDOR_ID AND VNDR.WTHD_SW = 'Y'
|