Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

DateTime issue

Hi,
I'm reading data through tMysqlInput and storing it as it is in a csv file. The table has a DateTime column and it sometimes has a value of '0000-00-00 00:00:00' but this value is stored in csv as '0002-12-31 00:00:00'. I'm also attaching tMysqlInput table schema. any idea?
Labels (2)
13 Replies
Anonymous
Not applicable
Author

also attaching the schema of tFileOutputDelimited.
regards,
Anonymous
Not applicable
Author

Hi abdul_rehman,
Do you have null values in the data that you're reading? Maybe it is just giving the default value to the nulls.
Anonymous
Not applicable
Author

Hi Khor,
the source table has '0000-00-00 00:00:00' which are stored as '0002-12-31 00:00:00', and you can also see that the default value of the column is set to '0000-00-00 00:00:00'.
Anonymous
Not applicable
Author

Hi,
Maybe you should test the date in a tmap. Which version of Talend do you use?
Anonymous
Not applicable
Author

Hi Or3l,
There is a tMap but i'm not doing any transformation there. And i'm using 4.2.2.
regards,
Anonymous
Not applicable
Author

Hi,
also tested the date column in tMap and entered '0000-00-00 00:00:00' in date column value and tested it. The output was '0000-00-00 00:00:00'.
Anonymous
Not applicable
Author

Hi,
any idea guys? or i have to deal with this with a case statement in LDR script?
regards,
Anonymous
Not applicable
Author

Hi,
I've gotten the exact same thing.
Instead of 0000-00-00 00:00:00
I get '0002-12-31 00:00:00' when data is pulled into Talend.
My job pulls the data from a MySQL table.
When look at the table from MySQL Workbench it says correctly 0000-00-00 00:00:00
Any ideas?
Anonymous
Not applicable
Author

It is caused because 0000-00-00 00:00:00 is not a valid date. It's a "bug" in MySQL. The first valid date should be 0001-01-01 00:00:00
there is never a day between the 31-12 and 1-1 by the way.