SELECT C1.COMPANY , C1.LANGUAGE_CD , C1.DESCR FROM %Table(COMPNY_TBL_LANG) C1 , %Table(COMPANY_TBL) C2 WHERE C1.EFFDT = ( SELECT MAX(C3.EFFDT) FROM %Table(COMPNY_TBL_LANG) C3 WHERE %Join(COMMON_KEYS, COMPNY_TBL_LANG C1, COMPNY_TBL_LANG C3, EFFDT) AND C3.EFFDT <= %CurrentDateIn) AND %Join(COMMON_KEYS, COMPNY_TBL_LANG C1, COMPANY_TBL C2) AND C2.EFF_STATUS = 'A' AND EXISTS ( SELECT 'X' FROM %Table(EOTF_DVMVALS_VW) DV , %Table(EOTF_ELEMENTS) EL , %Table(EOTF_ELEMENTSET) ES , %Table(FT_INSTALL) FT WHERE DV.EOTF_MAP_NAME = 'LEGAL_ENTITY_XREF' AND DV.EOTF_ELEMENT_VALUE = C1.COMPANY AND ES.EOTF_DOMAIN_NAME = FT.FT_DOMAIN_SOURCE AND %Join(COMMON_FIELDS, EOTF_DVMVALS_VW DV, EOTF_ELEMENTS EL) AND %Join(COMMON_KEYS, EOTF_ELEMENTS EL, EOTF_ELEMENTSET ES))
|