DATE COMPARISION in Transformer

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Billyqing
Participant
Posts: 44
Joined: Thu May 13, 2004 12:00 pm
Location: Canada

Post by Billyqing »

Your date format is not "D/E", but "DDMY[2,2,4]"

Code: Select all

@Date> Iconv(Ln_Histor_Data_In.FICHE_DEBUT_VALIDITE_CH, "D/E") And @Date < Iconv('Ln_Histor_Data_In.FICHE_FIN_VALIDITE_CH', "D/E") 

Try This:

Code: Select all

@Date> Iconv(Ln_Histor_Data_In.FICHE_DEBUT_VALIDITE_CH, "DDMY[2,2,4]") And @Date < Iconv('Ln_Histor_Data_In.FICHE_FIN_VALIDITE_CH, "DDMY[2,2,4]")


If it still does not work, you should make sure that your date met the constrain.
Bill
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard! :D

"DDMY" will be sufficient with Iconv(). See Date Conversion Demystified to learn why this is. Therefore your expression can be

Code: Select all

@DATE > Iconv(Ln_Histor_Data_In.FICHE_DEBUT_VALIDITE_CH, "DDMY") And @DATE < Iconv(Ln_Histor_Data_In.FICHE_FIN_VALIDITE_CH, "DDMY") 
Note also that the column name in the second Iconv() is not to be quoted; if it is you are trying to convert that string, rather than the column name.
Last edited by ray.wurlod on Wed Oct 27, 2004 3:41 pm, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rajender
Participant
Posts: 24
Joined: Wed Mar 31, 2004 6:10 am

Post by Rajender »

Hi Ray & Billy,

Thanks a Ton It works :D

Cheers
raj
Post Reply