Field("31|28|31|30|31|30|31|31|30|31|30|31", "|", MonthFromDate(InLink.dateVar))
How to get the last day of the current month in DataStage?
-
28-06-2022 - |
Pergunta
I have explored all the functions avialable in the trasformer, but could not found the exact function to get the last day of current month by passing date in same default format i.e. yyyy-mm-dd.Please help me in this regard.
Solução
Outras dicas
It is more precise to establish the first day of next month then use DateFromDaysSince function to establish the day before. I created an integer(6) stage variable which contained century and month+1 from source link e.g. 201410
DateFromDaysSince(-1, StringToDate(svIHBKPR, "%yyyy%mm") : "%yyyy-%mm-%dd")
There is a transformer function called DaysInMonth. Example: DaysInMonth(“2017-01-23”)= 31
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow