logic for updating date

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
chandiwalachintan
Participant
Posts: 7
Joined: Wed Jan 10, 2007 6:20 pm

logic for updating date

Post by chandiwalachintan »

I have an input column date datatype and it contains either 1st day of month or last day of month, i need to develop logic such that last day of month should be increased by one day and it becomes first day of next month and keep first day of months as it is.
Thanx
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There are functions available to handle 'Julian' dates. Use them to convert your 'last day of the month' to julian format, add 1 to that date (which will add 1 day) and then convert it back to an external date.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Check the day part with if then else and if its not '01' then convert to ordinal date using JulianDateFrom() function (I think thats what its called) to convert it and do as Craig advised.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chandiwalachintan
Participant
Posts: 7
Joined: Wed Jan 10, 2007 6:20 pm

Post by chandiwalachintan »

thank you very much
ivannavi
Premium Member
Premium Member
Posts: 120
Joined: Mon Mar 07, 2005 9:49 am
Location: Croatia

Post by ivannavi »

If you are selecting from Oracle, then I think I can help you...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

So could many of us. But there was nothing in the original post to suggest Oracle. You may be surprised to learn that not everyone in the world uses Larry's database.

A universally-applicable solution was required, and given.
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