Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Comparing 2 dates in Talend

Hi there,
I am trying to compare 2 dates in tmap but am getting error as 
"The operator >= is undefined for the argument type(s) java.util.Date, java.util.Date".
The condition that i am trying to put in is : TIMECREATED >= DATEADD(DAY , -30, CI_START_DT) && TIMECREATED <= CI_START_DT.
I need to fetch out data between start date and 30 days prior to start date. But as I try to use that as an expression, I get the error as stated above.
I have checked & confirmed the datatype of both columns.
Can you please help me.
Regards,
Sunny

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

They are there.
If your example is SQL syntax, you need to translate it to Java


public static int compareDate(Date date1, Date date2, String pattern)

public static Date addDate(Date date, int nb, String dateType)

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Take a look in Routines.system.TalendDate.

There are Date comparison routines to help you.
Anonymous
Not applicable
Author

I am not able to find something good in Talenddate.
Can you help me with something relevant.
Anonymous
Not applicable
Author

They are there.
If your example is SQL syntax, you need to translate it to Java


public static int compareDate(Date date1, Date date2, String pattern)

public static Date addDate(Date date, int nb, String dateType)