Five Stars

Problem with Date import into MySQL (date imported with wrong year)

Hi all,  

I am trying to import .txt file into MySQL database, and all columns are being imported but I am having an issue with the date where the year is showing 0015 or 0016 instead of 2015 or 2016.

The date column in the .txt file

27-Jul-15
27-Jul-15
27-Jul-15
27-Jul-15
20-Oct-15
25-May-15
25-May-15
25-May-15
25-May-15

 

What is being imported into the database:

0015-07-27
0015-07-27
0015-07-27
0015-07-27
0015-07-27
0015-07-27
0015-07-27
0015-10-20
0015-05-25
0015-05-25

 

I tried ParseDate, FormatDate and even without expression but doesn't seem to solve it.

What am I doing wrong ?

  • Data Quality
1 ACCEPTED SOLUTION

Accepted Solutions
Five Stars

Re: Problem with Date import into MySQL (date imported with wrong year)

Found the issue... so simple !

the txt had the date as dd-MMM-yy while i was using dd-MMM-yyyy

cheers

5 REPLIES
Employee

Re: Problem with Date import into MySQL (date imported with wrong year)

Hi,

 

Could you be a little more precise?

Like which product are you using? Which version?

If it's Studio, capture (at least) of your job?

 

Thx

Five Stars

Re: Problem with Date import into MySQL (date imported with wrong year)

Hi smallet, 
Thanks for quick reply!

I am using Talend Open Studio for Data Integration Version: 6.4

And this is the job i am doing:

1.JPG

 

 

 

 

 

 

 

Employee

Re: Problem with Date import into MySQL (date imported with wrong year)

So, you're using the Studio, that's good to know.

Could add more information, like the original file, the job?

Five Stars

Re: Problem with Date import into MySQL (date imported with wrong year)

the original file is a .txt and Date column as "dd-MMM-yyyy" as I added also as Metadata delimited file.

And Tmap as follows without any expression:

 

1.JPG

It is importing month and day correctly but the year is starting with 00 instead of 20 (0016 instead of 2016)

 

 

 

Five Stars

Re: Problem with Date import into MySQL (date imported with wrong year)

Found the issue... so simple !

the txt had the date as dd-MMM-yy while i was using dd-MMM-yyyy

cheers