SELECT MLS.OPRID , MLS.BUSINESS_UNIT , MLS.CONTRACT_NUM , AWD_LNG.TITLE56 , AWD_LNG.NAME1 , MLS.MILESTONE_ID , AWD_LNG.LANGUAGE_CD , TYPE_LNG.DESCR , CD_LNG.DESCR , ' ' FROM PS_GM_MLS_DUE_VW MLS , PS_GM_PREF_AWD_LVW AWD_LNG , PS_GM_MILE_TYPE MILE_TYPE , PS_GM_MILE_TYP_LNG TYPE_LNG , PS_GM_MILE_CODE MILE_CODE , PS_GM_MILE_CD_LNG CD_LNG WHERE AWD_LNG.CONTRACT_NUM = MLS.CONTRACT_NUM AND AWD_LNG.OPRID = MLS.OPRID AND AWD_LNG.BUSINESS_UNIT = MLS.BUSINESS_UNIT AND MILE_TYPE.MILESTONE_TYPE= MLS.MILESTONE_TYPE AND MILE_TYPE.SETID = ( SELECT REC.SETID FROM PS_SET_CNTRL_REC REC WHERE REC.RECNAME ='GM_MILE_TYPE' AND REC.SETCNTRLVALUE=AWD_LNG.BUSINESS_UNIT ) AND %EffdtCheck(GM_MILE_TYPE MILE_TYPE1, MILE_TYPE, %CurrentDateIn) AND MILE_TYPE.EFF_STATUS ='A' AND MILE_CODE.SETID = MILE_TYPE.SETID AND MILE_CODE.MILESTONE_TYPE = MILE_TYPE.MILESTONE_TYPE AND MILE_CODE.EFFDT = MILE_TYPE.EFFDT AND MILE_CODE.MILESTONE_CODE = MLS.MILESTONE_CODE AND MILE_TYPE.SETID = TYPE_LNG.SETID AND MILE_TYPE.MILESTONE_TYPE = TYPE_LNG.MILESTONE_TYPE AND TYPE_LNG.LANGUAGE_CD = AWD_LNG.LANGUAGE_CD AND MILE_TYPE.EFFDT = TYPE_LNG.EFFDT AND MILE_CODE.SETID = CD_LNG.SETID AND MILE_CODE.MILESTONE_CODE = CD_LNG.MILESTONE_CODE AND TYPE_LNG.LANGUAGE_CD = CD_LNG.LANGUAGE_CD AND MLS.MILESTONE_STAT= ' ' UNION SELECT MLS.OPRID , MLS.BUSINESS_UNIT , MLS.CONTRACT_NUM , AWD_LNG.TITLE56 , AWD_LNG.NAME1 , MLS.MILESTONE_ID , AWD_LNG.LANGUAGE_CD , MILE_TYPE.DESCR , MILE_CODE.DESCR , STA_LNG.DESCR FROM PS_GM_MLS_DUE_VW MLS , PS_GM_PREF_AWD_LVW AWD_LNG , PS_GM_MILE_TYPE MILE_TYPE , PS_GM_MILE_TYP_LNG TYPE_LNG , PS_GM_MILE_CODE MILE_CODE , PS_GM_MILE_CD_LNG CD_LNG , PS_GM_MILE_STA_LNG STA_LNG WHERE AWD_LNG.CONTRACT_NUM = MLS.CONTRACT_NUM AND AWD_LNG.OPRID = MLS.OPRID AND AWD_LNG.BUSINESS_UNIT = MLS.BUSINESS_UNIT AND MILE_TYPE.MILESTONE_TYPE= MLS.MILESTONE_TYPE AND MILE_TYPE.SETID = ( SELECT REC.SETID FROM PS_SET_CNTRL_REC REC WHERE REC.RECNAME ='GM_MILE_TYPE' AND REC.SETCNTRLVALUE=AWD_LNG.BUSINESS_UNIT ) AND %EffdtCheck(GM_MILE_TYPE MILE_TYPE1, MILE_TYPE, %CurrentDateIn) AND MILE_TYPE.EFF_STATUS ='A' AND MILE_CODE.SETID = MILE_TYPE.SETID AND MILE_CODE.MILESTONE_TYPE = MILE_TYPE.MILESTONE_TYPE AND MILE_CODE.EFFDT = MILE_TYPE.EFFDT AND MILE_CODE.MILESTONE_CODE = MLS.MILESTONE_CODE AND MILE_TYPE.SETID = TYPE_LNG.SETID AND MILE_TYPE.MILESTONE_TYPE = TYPE_LNG.MILESTONE_TYPE AND TYPE_LNG.LANGUAGE_CD = AWD_LNG.LANGUAGE_CD AND MILE_TYPE.EFFDT = TYPE_LNG.EFFDT AND MILE_CODE.SETID = CD_LNG.SETID AND MILE_CODE.MILESTONE_CODE = CD_LNG.MILESTONE_CODE AND TYPE_LNG.LANGUAGE_CD = CD_LNG.LANGUAGE_CD AND MLS.MILESTONE_STAT<>' ' AND MILE_CODE.SETID = STA_LNG.SETID AND MLS.MILESTONE_STAT = STA_LNG.MILESTONE_STAT AND TYPE_LNG.LANGUAGE_CD = STA_LNG.LANGUAGE_CD AND %EffdtCheck(GM_MILE_STA_LNG STA_LNG1, STA_LNG, %CurrentDateIn)
|