Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In my tMap component I'm trying to compare two dates, using this code in expression editor:
TalendDate.compareDate(parseDate("dd-MM-yyyy","01-01-2000"),row1.CREATEDDATE)
I need to compare the date "01-01-2000" to the date incoming from the dbInputTable row1 and, if equals, do something. Since I can't compare string and dates, I thought about parsing the string first to date and then compare, but when I hit "Test" in the expression builder I have this error:
the method parsedate is undefined for the type TalendJavaSourceViewer0
What does this mean? Where am I going wrong?
TalendDate.parseDate("dd-MM yyyy","01-01-2000")
Thats it. just add TalendDate.
@Dijke wrote:
TalendDate.parseDate("dd-MM yyyy","01-01-2000")Thats it. just add TalendDate.
I've already tried it but still doesn't work, gives me a generic error (exception in thread main).
I use something different for comparison.
// java.util.Date.before(Date when) // java.util.Date.after(Date when) // java.util.Date.compareTo(Date when) TalendDate.parseDate("dd-MM-yyyy","01-01-2000").compareTo(row1.CREATEDDATE)
Sidenote: on the TalendJavaSourceViewer ... is it a supported version of java?
@Dijke wrote:
I use something different for comparison.
// java.util.Date.before(Date when) // java.util.Date.after(Date when) // java.util.Date.compareTo(Date when) TalendDate.parseDate("dd-MM-yyyy","01-01-2000").compareTo(row1.CREATEDDATE)
Sidenote: on the TalendJavaSourceViewer ... is it a supported version of java?
I've tried this way doing this:
TalendDate.parseDate("dd-MM-yyyy","01-01-2000").compareTo(row1.CREATEDDATE) == 0 ? TalendDate.parseDate("dd-MM-yyyy","01-01-1900") : row1.CREATEDDATE
But when hitting "test" the same error appears
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Is there a way to see what this unresolved compilation problem is?
I restarted Talend and on the expression builder I have no errors now, but when I try to run the job an error appears saying:
object is not an instance of declaring class