Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am very new and would like to ask a simple question.
There is a function in TMap that allows me to compare 2 dates. My goal is to remove the rows where the 2 dates are the same.
The 2 rows i am comparing are TRADE_DATE and EXPIRY
TalendDate.compareDate(row1.TRADE_DATE,row1.EXPIRY,"dd-MM-yyyy") != 0
The 2 data inputs are are date data types.
When i run this, i get an error "Type mismatch: Cannot convert from date to string
Please help
Hi,
The condition TalendDate.compareDate(row1.TRADE_DATE,row1.EXPIRY,"dd-MM-yyyy") != 0 will output the value in the form of Boolean (true or false) since you are checking a condition.
So the output of the above condition should be mapped to a boolean variable. Similarly, your input data should be in date format and not in String. I believe one of your input data is a date value in String format. So you will have to first convert the data to Date data type using ParseDate function.
If your data types are correct, you will get output as shown below.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved
Hi,
The condition TalendDate.compareDate(row1.TRADE_DATE,row1.EXPIRY,"dd-MM-yyyy") != 0 will output the value in the form of Boolean (true or false) since you are checking a condition.
So the output of the above condition should be mapped to a boolean variable. Similarly, your input data should be in date format and not in String. I believe one of your input data is a date value in String format. So you will have to first convert the data to Date data type using ParseDate function.
If your data types are correct, you will get output as shown below.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved