Simple Date Conversion Issues

Eight Stars

Simple Date Conversion Issues

Hello All,

I have comma delimited flat file as my source, with row structure as 

cust_number

cust_name

cust_age

cust_gender

cust_height

cust_registered_date

001

Rado

25

M

5.4

01-jan-2015

002

John

65

M

4.9

10-nov-2016

 

my requirement is to convert the cust_registered_date into yyyy/mm/dd format and populate a target flat file....i am having issues with converting this cust_registered_date to any other format....read through as many posts as possible on the community and below is all i did, but with no success

1) Tried this conversion using TalendDate.parsedate, formatdate

2) Tried putting my input column data type to String, Date, similarly tried changing  variable port data type to string, date 

3) Tried using the formats yyyy-MMM-dd, yyyy-mmm-dd,yyyy-mon-dd 

4) Tried putting single quotes, double quotes, without quotes to the incoming values in the src file

 

My requirement if put in Sql would be a one liner:

to_date(cust_registered_date,'yyyy-mon-dd')

 

I still don't have a solution for this...can someone please help

 

Eleven Stars

Re: Simple Date Conversion Issues

which version of Talend you are using ?

Regards
Abhishek KUMAR
Eleven Stars

Re: Simple Date Conversion Issues

which version Talend you are using ?

Regards
Abhishek KUMAR
Eight Stars

Re: Simple Date Conversion Issues

Hello All,

 

Never mind...it is working fine now.

I deleted the existing tmap and recreated, this time it is working. I tried with various formats and interestingly it is working.

TalendDate.parseDate("MMM-dd-yyyy",row1.cust_registered)

 

While working with other ETL tools, I observed this behavior and the same seems to be applicable to Talend as well :-)

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 2

Part 2 of a series on Context Variables

Blog

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