Talend Connect
Virtual Summit
JOIN US!
And visit the Customer
& Community Lounge.
May 27-28, wherever you are.

Runtime exception: yyyy-MM-dd can't support the date!

Highlighted
Six Stars

Runtime exception: yyyy-MM-dd can't support the date!

Hi,

 

I'm trying to compare two string dates in Tmap. The logic is "DCDD - Forecasted_Receipt >=21". I create a local variable to represent "Forecasted_Receipt+21"  so I can use "compareTo()" syntax with another string date.

the local variable I create is TalendDate.addDate(row1.Forecasted_Receipt,"yyyy-MM-dd",21,"dd") with name "FRD21"

and I write Var.FRD21.compareTo(row1.DCDD)<=0  but the output shows below error that I don't know how to fix.

 

Capture.PNGCapture.PNG

 

Highlighted
Nine Stars

Re: Runtime exception: yyyy-MM-dd can't support the date!

Hi,

 

While adding days to specific date, no need to specify date format.

 

try this : TalendDate.addDate(Forecasted_Receipt,22,"dd") (Considering Forecasted_Receipt is date datatype)

 

Regards,

 

 

Veeru Boppudi
Highlighted
Six Stars

Re: Runtime exception: yyyy-MM-dd can't support the date!

Thank you!
For now I set string for Forcasted_Receipt so can you advise me in this situation?
Highlighted
Nine Stars

Re: Runtime exception: yyyy-MM-dd can't support the date!

If it is string then first convert string to date then add 21 days to date.

 

Regards,

Veeru Boppudi
Highlighted
Six Stars

Re: Runtime exception: yyyy-MM-dd can't support the date!

Hi,

 

If I convert to date data type I can not compare with other date because I use String data type for all.

I used String data type for all date in my report because this will not cause any unparseable date error.

  

Highlighted
Nine Stars

Re: Runtime exception: yyyy-MM-dd can't support the date!

Hi,

 

If it is string datatype you can not add number of days. May be you can convert string to date for required field in variable ports and use those variable port for calculation or filter. Use actual string datatype ports for taget.

 

Regards,

Veeru Boppudi

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog