Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.
Moderators: chulett , rschirm , roy
reshma11
Premium Member
Posts: 25 Joined: Mon Oct 13, 2008 7:52 am
Post
by reshma11 » Thu Aug 20, 2009 1:35 pm
How to add 2 years to system current date.
Thanks.
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Thu Aug 20, 2009 1:50 pm
Depends on how picky you are about "two years". If you go with the definition that says a year is 365 days, then use DateFromDaysSince() to add 730 days to the system date.
-craig
"You can never have too many knives" -- Logan Nine Fingers
Sainath.Srinivasan
Participant
Posts: 3337 Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom
Post
by Sainath.Srinivasan » Thu Aug 20, 2009 1:52 pm
What does 2 year constitue ? What is 2 years from 29/02/2008 ?
365 days per year or 12 months per year or only 2 years increment.
For first, you can do a DaysFromDateSince().
For other 2 options, search for DateToString() and StringToDate().
reshma11
Premium Member
Posts: 25 Joined: Mon Oct 13, 2008 7:52 am
Post
by reshma11 » Thu Aug 20, 2009 2:16 pm
[quote="reshma11"]How to add 2 years to system current date.
Thanks.
only 2 years increment and the format should be YYMM
Sainath.Srinivasan
Participant
Posts: 3337 Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom
Post
by Sainath.Srinivasan » Thu Aug 20, 2009 2:27 pm
I will suggest you try from the given information rather than asking the full solution.
We expect some effort from you also - apart from typing your requirement.
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Thu Aug 20, 2009 2:52 pm
Hmmm... then that sounds like just a little substring work and adding 2 to the YY portion before you glue them together.
-craig
"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607 Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:
Post
by ray.wurlod » Thu Aug 20, 2009 5:32 pm
With a little care where YY is "98" or "99".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Thu Aug 20, 2009 6:31 pm
Ah, true... you'd need to constrain it to the rightmost two digits but that's simple enough.
-craig
"You can never have too many knives" -- Logan Nine Fingers