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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to convert String to date in talend

hi,
i have date which is in string "MM/dd/yyyy" and i want to convert same format in DATE data type in talend,
means
"MM/dd/yyyy" data type(String) ---> MM/dd/yyyy data type(DATE)
how could i do this please provide the solution.
thanks and regards
Shailendra Shukla

Labels (2)
67 Replies
Anonymous
Not applicable
Author

yes, I was about to ask you this only. The nullpointer exception is comming because you have nulls in your source. It cannot convert null to date. That is the error here.
Anonymous
Not applicable
Author

So what you can do is handle the nulls in an "if" condition. I think you would be better off using a java component here. You can give a tjavarow component after your data fetch and use the following code :
output_row.ID = input_row.ID;
output_row.Name = input_row.Name;
output_row.DOB = TalendDate.parseDate("dd/mm/yyyy",input_row.DOB);
output_row.Sal = input_row.Sal;
if (input_row.HD != null)
output_row.HD = TalendDate.parseDate("dd/mm/yyyy",input_row.HD);
else
input_row.HD = null;

the nulls would be handled in the if condition.
_AnonymousUser
Specialist III
Specialist III

I use the following syntax when converting dates formats from strings

StringUtils.isBlank(row20.Execution_Date) ? " " : TalendDate.formatDate("yyyy-MM-dd",TalendDate.parseDate("MM/dd/yyyy",row20.Execution_Date))
Anonymous
Not applicable
Author

HI remytom,
Thank you for your reply , now i have a good result ..................
can you guide me how to install talend enterprise data integration tool on windows 7, if you can because i have more link while iam downloading it. like installer and manual installing
Anonymous
Not applicable
Author

I could guide you better if you mention what help you need in the installation specifically.
Which version of talend are you installing?
Anonymous
Not applicable
Author

Hi remytom,
Iam going to install talend enterprise date integration version 5.4.1 so for that i have two mode to install it .
one is manual installer and second is installer.
In installer i have only two links but in manual installation i have the following links
1.Talend studio,2.Talend administration center,3.Talend job server,4.Talend AMC Web,5.Talend BRMS.

What i have to do now.
Anonymous
Not applicable
Author

Hi anyone can help me how to solve this problem...........

I have a date in my Excel file is 01-JAN-06. 01 represents the day of the week, JAN represents the month and 06 represents the year. The Excel file also contains date values of 00-XXX-00 which represent no date. For example a column containing last purchase date data would look like this:"DateOfLastOrder"
"01-JAN-06"
"02-JAN-06"
"00-XXX-00"
"03-DEC-05"The value of 00-XXX-00 means that there is no purchase date.I want to bring these columns into my table and replace the 00-XXX-00 values with a NULL.
The table of tmssqloutput Data Type is datetime.
Anonymous
Not applicable
Author

Hi anyone can help me how to solve this problem...........

I have a date in my Excel file is 01-JAN-06. 01 represents the day of the week, JAN represents the month and 06 represents the year. The Excel file also contains date values of 00-XXX-00 which represent no date. For example a column containing last purchase date data would look like this:"DateOfLastOrder"
"01-JAN-06"
"02-JAN-06"
"00-XXX-00"
"03-DEC-05"The value of 00-XXX-00 means that there is no purchase date.I want to bring these columns into my table and replace the 00-XXX-00 values with a NULL.
The table of tmssqloutput Data Type is datetime.
This is the error iam getting 0683p000009MA5A.pngnly the date between january 1 1753 and december 31 accepted.
Anonymous
Not applicable
Author

Hi Mahadevank,
Sorry I could not help you with the installation!
But regarding your latest post, Could you tell in what date format you are reading the dates in talend and what is the date formats in the target? Have you checked the date formats in your target component (tmssqloutput in talend) and the SQL server database?
Regarding the replacement of the 00-XXX-00 values, what ae you using? Allthough the error does not seem because of it. But still, If you incorporate this code in a tjava component after reading the input file, it should handle all your non- date entries.
if (TalendDate.isDate(input_row.HD,"dd-MM-yyyy") == true)
output_row.HD = TalendDate.parseDate("dd-MM-yyyy",input_row.HD);
else
output_row.HD = null;
Anonymous
Not applicable
Author

Hi ,
i have started to intall talend enterprise edition 5.4.1 on windows 7 32 bit , its taking more than 24 hours still its not completed . can any one provide me what is the misstake i did...........
i have chosen talend installer option not manual installation.
I have selected all the option which is available in talend enterprise edition like administration center,job server, svn repository, every thing ..........