SELECT S.SETID , CG.CUST_ID , SCONL.CNTRCT_ID , SCONL.LANGUAGE_CD , SCONL.DESCR FROM PS_SET_CNTRL_REC S2 , PS_CUST_GROUP_TBL GRP , PS_SET_CNTRL_REC S , PS_CUST_CGRP_LNK CG , PS_SCON_HDR SCON , PS_SCON_HDR_LNG SCONL WHERE S.RECNAME = 'CUST_SLD_VW' AND S.SETCNTRLVALUE = SCON.SETID AND CG.SETID = S.SETID AND CG.CUSTOMER_GROUP = SCON.CUSTOMER_GROUP AND S2.RECNAME = 'CUSTGP_SCON_VW' AND S2.SETCNTRLVALUE = SCON.SETID AND GRP.SETID = S2.SETID AND GRP.CUSTOMER_GROUP = CG.CUSTOMER_GROUP AND CG.CUST_GRP_TYPE = 'SCON' AND GRP.EFF_STATUS = 'A' AND %EffdtCheck(CUST_GROUP_TBL GRP2, GRP, %CurrentDateIn) AND SCON.END_DT <= (%DateAdd(%CurrentDateIn, 30)) AND SCONL.SETID = SCON.SETID AND SCONL.CNTRCT_ID = SCON.CNTRCT_ID
|