min of two 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
consulting
Participant
Posts: 50
Joined: Fri Dec 21, 2007 3:24 am

min of two date

Post by consulting »

My reqriment is to find the minimum of two dates like (date1,date2)
How to do without transformation?

eg 05/11/2008 05/12/2008


i want output as 05/112008
balaji
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You can't. You need to "transform" them into something you can compare - either an ISO YYYY-MM-DD external format or an internal date using StringToDate().
-craig

"You can never have too many knives" -- Logan Nine Fingers
kittu.raja
Premium Member
Premium Member
Posts: 175
Joined: Tue Oct 14, 2008 1:48 pm

Re: min of two date

Post by kittu.raja »

[quote="consulting"]My reqriment is to find the minimum of two dates like (date1,date2)
How to do without transformation?

Hi,

You can do it in a tranformer. First convert the date to julian date which is a function in trnasformer and using aggregate function find the min. value and again convert back to original date.
Rajesh Kumar
Post Reply