Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I do a small job to test my inputs with TalendDate.compareDate function, but i am not satisfied to result.
Find bellow screenshot of tMap and also tlogRow output.
.---------+----------+--------------+--------------------+----------------------. | tLogRow_4 | |=--------+----------+--------------+--------------------+---------------------=| |ID |SourceDate|Dateplus30days|comparetoCurrentDate|comparetoCurrentDate_2| |=--------+----------+--------------+--------------------+---------------------=| |SF1081014|30/11/2018|30-12-2018 |1 |Y | |SF1016028|30/11/2018|30-12-2018 |1 |Y | |SF1017008|21/12/2018|20-01-2019 |-1 |N | |SF1017109|23/11/2018|23-12-2018 |1 |Y | |SF1017148|28/11/2020|28-12-2020 |1 |Y | |SF1017159|23/11/2018|23-12-2018 |1 |Y | |SF1017197|20/12/2018|19-01-2019 |-1 |N | |SF1017228|30/11/2018|30-12-2018 |1 |Y | |SF1018052|23/11/2018|23-12-2018 |1 |Y | |SF1018187|30/11/2018|30-12-2018 |1 |Y | |SF1018239|30/11/2018|30-12-2018 |1 |Y | '---------+----------+--------------+--------------------+----------------------'
Culumns : ID, SourceDate, Dateplus30days are correct
But i don't why column comparetoCurrentDate and comparetoCurrentDate_2 are not correct
These are my expressions:
comparetoCurrentDate
TalendDate.compareDate(TalendDate.addDate(row2.SourceDate,30,"dd") , TalendDate.getCurrentDate() , "dd/MM/yyyy" )
comparetoCurrentDate_2
row2.SourceDate != null && TalendDate.compareDate(TalendDate.addDate(row2.SourceDate,30,"dd") , TalendDate.getCurrentDate() , "dd/MM/yyyy" ) < 0 ? "N" : "Y"
May somebody explain why or what wrong
Thank you in advanced
Hi akular2301,
Thank you for your reply, i implement it and it works.
Bellow my expression
TalendDate.compareDate(TalendDate.addDate(row2.SourceDate,30,"dd") , TalendDate.parseDate("dd/MM/yyyy",TalendDate.getDate("dd/MM/yyyy")))