null dates, bad centuries, and iReport

I pass “from” and “to” parameters to iReport to select a range of dates. Some of the dates in the table are null, and some have '0001" or other questionable centuries in the year. I cannot seem be able to select these date.
SQl in iReport is like this:

...     and C6NOTES.NENTERDATE >= $P{from_nenterdate}  
     and C6NOTES.NENTERDATE <= $P{to_nenterdate} ...

In iReport, from_nenterdate and to_nenterdate parameters are class java.util.date. In Sybase, C6NOTES.NENTERDATE is a datetime field.

If I pass null to from_nenterdate, nothing gets selected (this is also the result using Sybase Interactive SQL). If I pass new Date(0000,1,1), Servoy converts it to ‘02/01/1900’ and only those records with dates greater than that are selected. If I pass new Date(‘01/01/0000’), Servoy converts it to ‘01/01/1900’. Oddly, new Date(‘01/01/1000’) is converted to ‘12/27/0999’ which causes iReport to error.

Anybody else able to select null or early dates using Servoy and iReport?

Michael,

Maybe you can use sybase’s function isnull(), possibly icw convert().

Rob