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

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

[resolved] Type mismatch: cannot convert string to date.

Hi,
I have a scenario in which data present in emp_dept.csv file should be split and inserted into two respective tables(EMP,DEPT)
Actually there is a field DOB declared as string in input schema(.csv file) but in EMP table the same column declared as date.
I tried with tMap TalendDate.formatting function also but getting the following error.
Type mismatch: cannot convert string to date.
Can somebody help me to overcome the situation.
Thanks
Babu Chokka

Labels (3)
5 Replies
Anonymous
Not applicable
Author

Hi
Have you tried to use formatDate function?
TalendDate.formatDate("yyyy-MM-dd HH:mm:ss",myDate)
Anonymous
Not applicable
Author

Hi,  I have tried using the TalendDate.formatDate function but still getting the type mismatch error.
I have two tables EMP and DEPT, I am trying to insert records from .CSV file to these tables using tMap.
- EMP contains columns EMP_NO, NAME, DOB, DESIGNATION and DEPT_NO
- DEPT contains columns DEPT_NO and DEPT_NAME  
While inserting giving the below error since DOB is string in .CSV file but the DOB column declared as Date in EMP table.
Note :- Due to Date datatype only getting the error, if we make the DOB column as varchar2 then there is no issue.
Anonymous
Not applicable
Author

sorry forgot to keep the error i.e, Type mismatch :cannot convert from string to date
Anonymous
Not applicable
Author

Hi Daniel,
Thanks for your guidance, it worked for me when I tried with TalendDate.parseDate("dd/MM/yyyy",row1.DOB(input schema column name))
Regards
Babu Chokka
Anonymous
Not applicable
Author

Hi, in this format 

TalendDate.parseDate("dd/MM/yyyy",row1.DOB(input schema column name))

can you please what to substitute in place of input schema