Unparseable date error

Highlighted
Eight Stars

Unparseable date error

I am getting "Unparseable date" error by using the below code.

 

"".equals(ColName) || ColName == null ? "" : TalendDate.formatDate("yyyy-MM-dd",TalendDate.parseDate("MM-dd-yyyy","ColName"))

 

Input is "Date" type, i am converting it to String type. I am also trying to replace null with blank values


Accepted Solutions
Eight Stars

Re: Unparseable date error

Yes Manohar, it didnt work. 

 

Also, the output table should store the date in "yyyy-mm-dd" format.


All Replies
Forteen Stars

Re: Unparseable date error

@samisyed80,what is the source date format? do you just need to convert date to string?

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Eight Stars

Re: Unparseable date error

Source is DATE type, format "MM-dd-yyyy"

 

Destination is STRING type "yyyy-MM-dd"

Forteen Stars

Re: Unparseable date error

@samisyed80,to convert date from one format to another use below way. are you loading to excel file out it doesnt matter sting or date

Untitled.png

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Eight Stars

Re: Unparseable date error

My source is Date type. but your example is having string type in source. Is that going to impact?

Forteen Stars

Re: Unparseable date error

@samisyed80,sorry,previous worng screenshot.

 

find teh correct one.Untitled.png

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Eight Stars

Re: Unparseable date error

OK, now, i don't want null in this column, how to replace it with SPACE or BLANK?

 

 

Forteen Stars

Re: Unparseable date error

@samisyed80,use this way

"".equals(ColName) || ColName == null ? "" : ColName

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Eight Stars

Re: Unparseable date error

Some of the date rows are having null. If i put that code to replace with BLANK's then Cant convert String to Date error is throwing. 

 

 

Forteen Stars

Re: Unparseable date error

try the below one.Untitled.png

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Forteen Stars

Re: Unparseable date error

@samisyed80,still do you have issue?

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Eight Stars

Re: Unparseable date error

Yes Manohar, it didnt work. 

 

Also, the output table should store the date in "yyyy-mm-dd" format.

2019 GARNER 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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download