Unparseable date error

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
Highlighted
Eight Stars

Re: Unparseable date error

Yes Manohar, it didnt work. 

 

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

View solution in original post


All Replies
Highlighted
Moderator

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.
Highlighted
Eight Stars

Re: Unparseable date error

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

 

Destination is STRING type "yyyy-MM-dd"

Highlighted
Moderator

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.
Highlighted
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?

Highlighted
Moderator

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.
Highlighted
Eight Stars

Re: Unparseable date error

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

 

 

Highlighted
Moderator

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.
Highlighted
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. 

 

 

Highlighted
Moderator

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.
Highlighted
Moderator

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.
Highlighted
Eight Stars

Re: Unparseable date error

Yes Manohar, it didnt work. 

 

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

View solution in original post

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