Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
There is a mySQL variable in "YEAR" datatype i.e. present in "yyyy" and I would like to convert it as int through Talend.
I use tMap with expression function formatDate to convert the type as str and then use tConvertType compo to convert the str as int. When I look up the result by tLogRow. the variable is unable to represent with error java.text.ParseException: Unparseable date: "2004". How can I solve the issue?
Assuming you have the correct syntax of TalendDate.formatDate(), are you sure the year column is on the database as a date type and the schema within Talend is a date time?
Thanks
David
Check to make sure the input is a valid date format then use.
TalendDate.getPartOfDate("YEAR",yourdate)
This returns an INT type without the need of the tconverttype