Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I need to compare date with 3years future date.
Basically, I need to compare if the incoming date is lesser/greater than (current day+3yrs 7days) of future date. For example, if the incoming date is 20/dec/2021, i need to check if this is greater than (current day+3yrs 7days = 7/dec/2021). how to achieve this in tMap?
Can someone please help me in this?
@joe86,you can add the 3years 7days as shown in below in tmap.
TalendDate.addDate(TalendDate.addDate(TalendDate.getCurrentDate() ,7,"dd"),3,"yyyy")
for comparison you should do below way.
TalendDate.compareDate(row2.date1 ,row2.date2 )==1 if it 1 means date1 is grater than date2,if it is -1 means date1 is less than date2,if it is 0 means date1 is equal to date2. you can do all these in tMap.
any help please
@joe86,you can add the 3years 7days as shown in below in tmap.
TalendDate.addDate(TalendDate.addDate(TalendDate.getCurrentDate() ,7,"dd"),3,"yyyy")
for comparison you should do below way.
TalendDate.compareDate(row2.date1 ,row2.date2 )==1 if it 1 means date1 is grater than date2,if it is -1 means date1 is less than date2,if it is 0 means date1 is equal to date2. you can do all these in tMap.
does 20/dec/2021 + 3 year + 7 days == 7/dec/2021 ?
may be 27/dec/2021?
you can use this formula in tMap
TalendDate.addDate(TalendDate.addDate(TalendDate.getCurrentDate(),3,"yyyy"),7,"dd")
replace TalendDate.getCurrentDate() with your own date column
--