cancel
Showing results for 
Search instead for 
Did you mean: 

_SYS_BI.M_TIME_DIMENSION how to replace this table

former_member666435
Participant
0 Kudos
192

Hi all,

I am transferring a few queries from Hana SQL into T_SQL and this bit of the query needs a change on the TimeDimension table (replacement), can anyone help me with that?

    Select
      T0."AcctCode",
      T0."AcctName",
      Y."Year",
      Y."Month#",
      Y."Month"
    from
      OACT T0,
      (
        Select
          distinct Year(n0."DATE_SQL") "Year",
          CASE
            WHEN Month(n0."DATE_SQL") IN ('1', '2', '3', '4', '5', '6', '7', '8', '9') THEN CAST(CONCAT('0', Month(n0."DATE_SQL")) AS VARCHAR(2))
            ELSE CAST(Month(n0."DATE_SQL") AS VARCHAR(2))
          END AS "Month#",
          DATENAME(month, n0."DATE_SQL") AS "Month"
        from
          _SYS_BI.M_TIME_DIMENSION n0
      ) Y

Accepted Solutions (0)

Answers (0)