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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Too much time on this problem (java.sql.SQLException: Conversion failed when converting date and/or time from character string)

 

I have a very persistent error that I have detailed in the attached PDF. Thanks so much for any help!

 

Allen

Labels (2)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

You may convert the input dates as String then use the result for the comparison:

select convert(varchar(19), yourDateColumn, 120) AS date1

Also the inner join seems strange to me, but no time left to analyze in detail.

Should "SELECT ... ON xxxxxx WHERE date1 > '" + (String)globalMap.get("foo") + "'".

No?

View solution in original post

2 Replies
TRF
Champion II
Champion II

You may convert the input dates as String then use the result for the comparison:

select convert(varchar(19), yourDateColumn, 120) AS date1

Also the inner join seems strange to me, but no time left to analyze in detail.

Should "SELECT ... ON xxxxxx WHERE date1 > '" + (String)globalMap.get("foo") + "'".

No?

Anonymous
Not applicable
Author

The solution kindly provided stopped errors, but the date format still was not bringing correct results. 

I finally had to keep the date as a date and not a string and use this to make it work correctly:

 AND  A.[DATE_ADDED] >  ' " + TalendDate.formatDate("yyyy-MM-dd hh:mm:ss", (Date)globalMap.get("maxDate"))  + " '

 

Thanks for your help