Here is the simplest version of this issue I could create: In iReport I have the NEW_DATE parameter set properly as a java.util.Date with default value new Date() and the NEW_INT as a java.lang.Integer with default value as new Integer().
If I set up my query something like this
SELECT something
FROM table
WHERE date = $P{NEW_DATE}
AND index = $P{NEW_INT}
When I try and read the fields with this query I get:
Error: SQL problems:ERROR: invaild input syntax for integer: "Thu Feb 01 13:23:36 PST 2007"
However if I change the ordering of the conditions in the query it reads the fields fine:
SELECT something
FROM table
WHERE index= $P{NEW_INT}
AND date = $P{NEW_DATE}
I have been able to get around this in more complex queries in one of two ways either by reordering the conditionals or by commenting them out, reading the fields and then adding the conditional statements back in. I'm connecting to a PostgreSQL database.
Recommended Comments