Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Compare two dates

In a tmap component I would like to compare two dates

The first one has the format "dd-MM-yyyy"
The seconde one has teh format "yyyyMMdd"

I have tried :

TalendDate.compareDate(row1.date_expedition, row2.DATELOG,"dd-MM-yyyy")

I have the following message : "La méthode compareDate() du type TalendJavaSourceViewer7.TalendDateStruct ne
 s'applique pas aux arguments (Date, Date, String)"

In english , something like "You cannot use it with arguments (Date, Date, String"

What is the best solution?

Thanks

Didier

Labels (2)
2 Replies
Anonymous
Not applicable
Author

Hi,

What's your expected result? For TalendDate.compareDate(Date date1, Date date2, String pattern) method, the result whether two date is the same, if first one less than second one return number -1, equlas  * return number 0, bigger than return number 1.

Best regards
Sabrina


    
Anonymous
Not applicable
Author

I agrre and it's what I'm expected


but why this message : The compareDate () method of the type does TalendJavaSourceViewer7.TalendDateStruct
  not apply to arguments (Date, Date, String)