Page 1 of 1

how to get previous month value from given date vaule

Posted: Sat Feb 21, 2009 3:40 pm
by sathishmca
Hi,
Can any one tell me how to get previous month value from given date vaule?

Ex: 22-2-2009 ---> 22-1-2009

Please do the need full.

Posted: Sat Feb 21, 2009 7:16 pm
by DSguru2B
What happens if your date is 31-03-2009 ???

Posted: Sat Feb 21, 2009 9:08 pm
by chulett
Ray has some pre-built Server date handling routines he loves to give away. As they say 'Why reinvent the wheel?' :wink:

Posted: Sun Feb 22, 2009 3:44 am
by ray.wurlod
DataStage itself has some really useful built-in Transforms, particularly MONTH.FIRST and MONTH.LAST. These will go a long way you solving your not-very-well-specified problem. We don't really know, in a general sense, what problem you are trying to solve.