Adding a month in a Date column

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

Post Reply
Gopinath
Participant
Posts: 52
Joined: Wed Apr 25, 2007 2:18 am
Location: Chennai

Adding a month in a Date column

Post by Gopinath »

Hi friends,

I want to add "5months and two weeks" in a date column(Timestamp).
What is the function i need to use. Can anybody help me on this.
Thanks.
Gopinath
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Search for DaysFromDateSince. And then decide what "5 months and 2 weeks" means - 154 days? And is it a date or a timestamp?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Gopinath
Participant
Posts: 52
Joined: Wed Apr 25, 2007 2:18 am
Location: Chennai

Post by Gopinath »

chulett wrote:Search for DaysFromDateSince. And then decide what "5 months and 2 weeks" means - 154 days? And is it a date or a timestamp? ...
Hi,

It's a Timestamp field. Will it work for Timestamp also. Let me try this option and also pls let me know if any other method is there for
Timestamp.

Thanks.
Gopinath
Gopinath
Participant
Posts: 52
Joined: Wed Apr 25, 2007 2:18 am
Location: Chennai

Post by Gopinath »

chulett wrote:Search for DaysFromDateSince. And then decide what "5 months and 2 weeks" means - 154 days? And is it a date or a timestamp? ...
Hi,

It's a Timestamp field. Will it work for Timestamp also. Let me try this option and also pls let me know if any other method is there for
Timestamp.

Thanks.
Gopinath
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You'll need to 'remove' the time portion, work the magic on the date portion and then pop the two pieces back together, AFAIK.
-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 »

You need to add five months then add two days, perhaps in two stage variables in the Transformer stage. This requirement can not be done as a single generic function because month lengths are unequal. Is there anything special about "five months and two days" (just curious) or is this a specific example of a more general problem to solve?
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
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

They stated "5 months and 2 weeks", not days. And yes, does seem like a curious interval and dependant on their definition of a month in this case.
-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 »

Two wrongs don't make a right. But three lefts do.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply