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

[resolved] Unparseable date: "0"

Hi,
I'm new to Talend. I'm trying to load delimited (,) file to SQL server table. My input field CURBEGDT has dates with format (yyyyMMdd) as well as some invalid date values like "0". My output table in SQL Db contains CURBEGDT field with datetime data type. To handle invalid dates "0" I'm using tMap with following code :
row2.CURBEGDT.isEmpty() || row2.CURBEGDT == "0"
? TalendDate.getCurrentDate()
: TalendDate.parseDate("yyyyMMdd",row2.CURBEGDT)
But I'm still getting following error. Can somebody please help me? This is ASAP.
Starting job FTP_Daily_Scan at 15:22 30/08/2011.
connecting to socket on port 3727
connected
Exception in component tMap_1
java.lang.RuntimeException: java.text.ParseException: Unparseable date: "0"
at routines.TalendDate.parseDate(TalendDate.java:643)
at training___joshi.ftp_daily_scan_0_1.FTP_Daily_Scan.tFileList_1Process(FTP_Daily_Scan.java:2935)
at training___joshi.ftp_daily_scan_0_1.FTP_Daily_Scan.runJobInTOS(FTP_Daily_Scan.java:3808)
at training___joshi.ftp_daily_scan_0_1.FTP_Daily_Scan.main(FTP_Daily_Scan.java:3682)
Caused by: java.text.ParseException: Unparseable date: "0"
at java.text.DateFormat.parse(Unknown Source)
at routines.TalendDate.parseDate(TalendDate.java:641)
... 3 more
disconnected
Job FTP_Daily_Scan ended at 15:22 30/08/2011.
Labels (3)
1 Solution

Accepted Solutions
alevy
Specialist
Specialist

You cannot use == with Strings. Change your expression to the following and it should work:
row2.CURBEGDT.isEmpty() || row2.CURBEGDT.equals("0")
? TalendDate.getCurrentDate()
: TalendDate.parseDate("yyyyMMdd",row2.CURBEGDT)

View solution in original post

3 Replies
alevy
Specialist
Specialist

You cannot use == with Strings. Change your expression to the following and it should work:
row2.CURBEGDT.isEmpty() || row2.CURBEGDT.equals("0")
? TalendDate.getCurrentDate()
: TalendDate.parseDate("yyyyMMdd",row2.CURBEGDT)
Anonymous
Not applicable
Author

Thanks... that helped. Thank you very much. 0683p000009MACn.png
Anonymous
Not applicable
Author

Thank you so much.. It helped me alot..