How To find the previous month??
Moderators: chulett, rschirm, roy
How To find the previous month??
I got a job which prompts for the day of run... If no value is passed it should take the previous month's date... how to get that??
222102
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Code: Select all
If @MONTH = 1 Then (Oconv(@DATE,"DY") - 1) : "-12-" : Oconv(@DATE,"DD") Else Oconv(@DATE,"DY") : "-" : (Oconv(@DATE,"DM") - 1) : "-" : Oconv(@DATE,"DD")
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.
-
- Participant
- Posts: 33
- Joined: Mon Nov 12, 2007 1:02 am
- Location: Bangalore
Re: How To find the previous month??
For any such activities, I usually employ scripts and use command stage at sequencer level to implement the logic. Your scripts can return values to the jobs as parameters.SHARAD123 wrote:I got a job which prompts for the day of run... If no value is passed it should take the previous month's date... how to get that??
Can you give some more information, of what exactly u mean by previous month's date? and day of run?
Rishabh Sagar V
Bangalore
Bangalore