on 02-03-2015 1:59 PM
Dear All,
We are using the MSU(multi source universe) which uses data federator functions.
Requirement is to create the following object
3 digits format (current month - 1).
So it should return 001 now as current month is Feb.
How we can achieve it here as ADD_MONTH function doesnt work here.
We could get it after applying below logic but how to format a date we are stuck.
CASE WHEN (month(curDate()))<=1 THEN concat('0',toString(month(curDate()) +11))
ELSE concat('0', toString(month(curDate())-1)) END
Regards,
SN
Got it working by below formula:
case when TOSTRING((MONTH(timestampAdd('SQL_TSI_MONTH', -1, now())))) <=9 THEN concat('00',TOSTRING((MONTH(timestampAdd('SQL_TSI_MONTH', -1, now()))))) ELSE concat('0',TOSTRING((MONTH(timestampAdd('SQL_TSI_MONTH', -6, now()))))) END
Does anyone have better approach
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.