on 2020 Nov 12 3:45 PM
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
Request clarification before answering.
User | Count |
---|---|
106 | |
39 | |
6 | |
5 | |
4 | |
3 | |
3 | |
2 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.