How To find the previous month??
Posted: Thu Jan 17, 2008 9:28 pm
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??
A short text to describe your forum
http://dsxchange.com./
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")
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??