One Star

[resolved] How to compare dates in Talend

Hi,
I have two Oracle tables. TableA is the source table and TableB is the datamart table. Both tables have the same structure. What I want to do is to update datamart's TableB with data from TableA.
I have loaded the data from both tables in a HashOutput component and I have made TableB a lookup for Table A.
To update my datamart, I just wanted to look for data where tableA.row_changed_date is greater than tableB.row_changed_date.
I've tried using TalendDate.CompareDate but it seems like it's not working since it's not giving the expected result. Attach is my tmap mapping.. Can someone please check if I'm doing anything wrong? What is the best way to do date comparison in Talend?
I am using TOS5.2.
Thanks,
Josephine
1 ACCEPTED SOLUTION

Accepted Solutions
One Star

Re: [resolved] How to compare dates in Talend

Hi, Josephine,
Try this TalendDate.diffDate(tableA.row_changed_date, tableB.row_changed_date,"dd") > 0
2 REPLIES
One Star

Re: [resolved] How to compare dates in Talend

Hi, Josephine,
Try this TalendDate.diffDate(tableA.row_changed_date, tableB.row_changed_date,"dd") > 0
One Star

Re: [resolved] How to compare dates in Talend

Thanks Lino! It worked.. Smiley Happy