SELECT A.SETID1 , A.LEDGER_GROUP ,SP.SUBTYPE , ' ' , ' ' , ' ' , B.LEDGER_GROUP , ' ' , ' ' FROM PS_KK_BUDGET_TYPE A , PS_KK_BUDGET_TYPE B ,PS_KK_SUBTYPE SP ,PS_KK_SUBTYPE SC WHERE A.SETID1=B.SETID1 AND B.LEDGER_GROUP=A.PARENT_BUDGET AND SP.CALENDAR_ID=' ' AND SC.CALENDAR_ID=' ' AND A.EFFDT=( SELECT MAX(EFFDT) FROM PS_KK_BUDGET_TYPE WHERE LEDGER_GROUP=A.LEDGER_GROUP AND SETID1=A.SETID1 AND EFFDT<=%CurrentDateIn) AND B.EFFDT=( SELECT MAX(EFFDT) FROM PS_KK_BUDGET_TYPE WHERE LEDGER_GROUP=B.LEDGER_GROUP AND SETID1=B.SETID1 AND EFFDT<=%CurrentDateIn) AND A.EFF_STATUS='A' AND B.EFF_STATUS='A' AND SP.SETID1=B.SETID1 AND SP.LEDGER_GROUP=B.LEDGER_GROUP AND SP.EFFDT=B.EFFDT AND SC.SETID1=A.SETID1 AND SC.LEDGER_GROUP=A.LEDGER_GROUP AND SC.EFFDT=A.EFFDT AND SP.SUBTYPE=SC.PARENT_SUBTYPE
|