Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Can anyone please advise me below issue? Thanks a lot! -
My purpose was to compare if "ETD" is later than "ETA Port" in string data type
I changed my schema to show "string" for two dates, and then I wrote syntax - ETD.compareTo(ETA_to_Discharge_Port)>0
I think my syntax is correct to compare two strings (please correct me if I am wrong) and then I got below output which ETD is earlier than ETA Port
Thanks!
After I change my syntax to TalendDate.compareDate(Var.var1,Var.var2)>0 I still get below errors -
please provide tMap configurations.
Regards,
Hi,
I filtered out the empty data and I don't have issue for parse date error for now.
but I have other issue - the output I want is data with ETD>ETA
For now no matter what I change equation I got ETD<ETA (var1 is ETA and var2 is ETD)
Try the following:
TalendDate.compareDate(Var.ETA_Date,Var.ETD_Date)<0
@rchinta date1 (Var.ETA_Date)
@rchinta date2 (Var.ETD_Date)
@return the result wheather two date is the same,
if first one less than second one return number -1 (Var.ETA_Date<Var.ETD_Date)
equal's return number 0 (Var.ETA_Date=Var.ETD_Date)
bigger than return number 1. (Var.ETA_Date>Var.ETD_Date)
Regards,
@szhou1,you were getting empty value in date coumn,since you were not able to convert.
can you cehck with below expressions in Variable.
"".equals(row1.EDT) || row1.EDT == null ? "" : TalendDate.parseDate("mm/DD/yyyy",row1.EDT))
"".equals(row1.ETA) || row1.ETA == null ? "" : TalendDate.parseDate("mm/DD/yyyy",row1.ETA))
its NOT TalendDate.parseDate("mm/DD/yyyy",row1.ETA))
But "MM/dd/yyyy"
mm=minutes
MM=Month