SELECT A.TRANS_DATE , B2.LANGUAGE_CD , CASE WHEN B.ACCOUNTING_PERIOD < 10 THEN (%NumToChar(B.FISCAL_YEAR) %Concat '-0' %Concat %NumToChar(B.ACCOUNTING_PERIOD) %Concat '-' %Concat B2.PERIOD_ABBRV) ELSE (%NumToChar(B.FISCAL_YEAR) %Concat '-' %Concat %NumToChar(B.ACCOUNTING_PERIOD)%Concat '-' %Concat B2.PERIOD_ABBRV) END , B.PERIOD_NAME , B.PERIOD_ABBRV , CASE WHEN D.ACCOUNTING_PERIOD < 10 THEN (%NumToChar(B.FISCAL_YEAR) %Concat '-0' %Concat %NumToChar(D.ACCOUNTING_PERIOD) %Concat '-' %Concat D2.PERIOD_ABBRV) ELSE (%NumToChar(B.FISCAL_YEAR) %Concat '-' %Concat %NumToChar(D.ACCOUNTING_PERIOD) %Concat '-' %Concat D2.PERIOD_ABBRV) END , A.CALENDAR_MONTH , A.CALENDAR_QUARTER FROM PS_WM_DATE A , PS_CAL_DETP_LANG B2 , PS_CAL_DETP_TBL B , PS_WM_REPORT_SETUP C , PS_CAL_SUMP_LANG D2 , PS_CAL_SUMP_TBL D WHERE B.SETID = C.SETID AND B.CALENDAR_ID = C.WM_MONTH_CALENDAR AND A.TRANS_DATE BETWEEN B.BEGIN_DT AND B.END_DT AND D.SETID = C.SETID AND D.CALENDAR_ID = C.WM_QTR_CALENDAR AND D.FISCAL_YEAR = B.FISCAL_YEAR AND B.ACCOUNTING_PERIOD BETWEEN D.DETL_PERIOD_FROM AND D.DETL_PERIOD_TO AND B2.LANGUAGE_CD = D2.LANGUAGE_CD AND %Join(COMMON_KEYS,CAL_DETP_LANG B2, CAL_DETP_TBL B) AND %Join(COMMON_KEYS,CAL_SUMP_LANG D2, CAL_SUMP_TBL D)
|