I am passing parameters to a Job activity in the sequence. I have two parameters current month (YYYYMM format) and previous month (YYYYMM) format. Is there a way to derive previous month from the current month (preferably in the Value Expression section of the Job Activity)?
Please suggest.
How to get previous month in the sequence/Basic language
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 425
- Joined: Sat Nov 19, 2005 9:26 am
- Location: New York City
- Contact:
...and you have the current month, right? Then it will be a matter of date arithmetic. Resolved the first day of the current month and substract 1 day to it.
OConv(Iconv(CurrMonth:"01" ,"D YMD[4,2,2]") - 1), "D YM[4,2]")
I would suggest to do this in a user variable and then pass the user variable to the job's parameter instead of doing this logic directly on the value expression for the paraneter
OConv(Iconv(CurrMonth:"01" ,"D YMD[4,2,2]") - 1), "D YM[4,2]")
I would suggest to do this in a user variable and then pass the user variable to the job's parameter instead of doing this logic directly on the value expression for the paraneter
Julio Rodriguez
ETL Developer by choice
"Sure we have lots of reasons for being rude - But no excuses
ETL Developer by choice
"Sure we have lots of reasons for being rude - But no excuses
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Take a look at the date Transforms supplied in every project. There are useful, pre-defined Transforms for things like MONTH.FIRST and MONTH.LAST, which can recognize a MONTH.TAG structure such as you are using.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.