I need to check the column DATE is between 2017-01-01 and 2017-12-31. If YES, then i should pass the value as 1 to the output field. How can i do this?
When i gave <= and >= in tMAP, its not accepting.
Solved! Go to Solution.
TalendDate.compareDate(row1.yourDateField, TalendDate.parseDate("yyyy-MM-dd", "2017-01-01"), "yyyy-mm-dd") >= 0 && TalendDate.compareDate(row1.yourDateField, TalendDate.parseDate("yyyy-MM-dd", "2017-12-31"), "yyyy-mm-dd") <= 0
Hope this helps.
The example I gave you works fine for me.
Share your piece of code.
The date comparison is not "complicated" due to Talend but to Java.
EncounterActivityDate field seems to be a String but should be a Date.
Have a look to TalendDate.parseDate to convert from String to Date datatype.
Watch the recorded webinar!
Create systems and workflow to manage clean data ingestion and data transformation.
Introduction to Talend Open Studio for Data Integration.
Test drive Talend's enterprise products.