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
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
Thirteen Stars

Re: Unparseable date error

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

Manohar B
Eight Stars

Re: Unparseable date error

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

 

Destination is STRING type "yyyy-MM-dd"

Thirteen 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
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?

Thirteen Stars

Re: Unparseable date error

@samisyed80,sorry,previous worng screenshot.

 

find teh correct one.Untitled.png

Manohar B
Eight Stars

Re: Unparseable date error

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

 

 

Thirteen Stars

Re: Unparseable date error

@samisyed80,use this way

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

Manohar B
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. 

 

 

Thirteen Stars

Re: Unparseable date error

try the below one.Untitled.png

Manohar B
Thirteen Stars

Re: Unparseable date error

@samisyed80,still do you have issue?

Manohar B
Eight Stars

Re: Unparseable date error

Yes Manohar, it didnt work. 

 

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