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

How to convert string to date format!

Hi Talend Support officer,
Can you tell me how can I convert the string data of "14/09/2001" from MS Access to DB2 date format ("yyyy-mm-dd") as "2001-09-14" by using tMap function in Talend Open Studio, please?
Thanks.
Regards,
KM

Labels (2)
58 Replies
djugal
Contributor III
Contributor III

hi,
first convert the column to built-in schema & edit your date column from string to date datatype format "dd-mm-yyyy"
then in tmap use function TalendDate.formatDate("yyyy-MM-dd",myDate) to get your desired format.
regards,
Jugal
Anonymous
Not applicable
Author

Hi Jugal,
Thanks for the tips. I still having problem after I changed the column of the datatype from string to date for the input column. Then in tmap, I put the function as TalendDate.parseDate("yyyy-MM-dd",PATIENT.Patient_DOB). It still giving me this error as => Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method parseDate(String, String) in the type TalendDate is not applicable for the arguments (String, Date).
Unfortunately, I am unable to provide you the dump screen due to network bandwidth limitation. Can you help me with this error, please? Thanks.
Regards,
KM
djugal
Contributor III
Contributor III

Try this function TalendDate.formatDate("yyyy-MM-dd",myDate)
Anonymous
Not applicable
Author

Hi
Use this way
TalendDate.parseDate("yyyy-MM-dd",TalendDate.formatDate("dd/MM/yyyy"))
This case work if the incoming data type is string else use parseDate directly with pattern "dd/MM/yyyy"
_AnonymousUser
Specialist III
Specialist III

The problem is i have a string "2008013008013661" i got to truncate it to "20080130080136" then convert this string to date format which i should be able to insert into mySql db
Anonymous
Not applicable
Author

I have a date object, and for NULL date i want to store blank in excel file. Please suggest any way
Anonymous
Not applicable
Author

use Relational.ISNULL function to check if null. If null pass as null object
Anonymous
Not applicable
Author

Hi can any one help me to solve this problem..........Hi , i have a source in excel with the following data
id name dateofbirth salary hiredate
1 xays 24/01/1994 100 05/07/2012
2 xyz 22/10/1991 200 04/02/2012
3 kjsdj 04/02/1990 300 14/01/2008
4 dfdkl 06/06/1989 400 16/02/2010
here rowno1 24/01/1994,dateofbirth is displaying in excel as a general format
and rowno2 22/10/1994 dateofbirth is displaying in excel as a general format
and rowno 4 16/02/2010 hiredate is displaying in excel as a general format. so while iam loading this from excel to target iam getting the following error
The cell format is not date in row1 date of birth
The cell format is not date in row2 date of birth
The cell format is not date in row4 hire date Because the above mentioned rows are in general format in excel sheet.
my expetation is i want to get all the rows from source to target.
But if i used parsedate in tmap the complete date value has been changed like.....
row1 date is 24/01/1994 as changed to like this 01/12/95 and
row2. 22/10/1991 is changed to 10/10/19992
can you show me the screen shot please for this solution
Anonymous
Not applicable
Author

Hi Mahadevank,
Have you checked the date format of your output schema in tmap?