# null dates, bad centuries, and iReport

**URL:** <https://forum.servoy.com/t/null-dates-bad-centuries-and-ireport/11316>\
**Category:** Classic Servoy\
**Created:** [October 23, 2009, 3:05pm UTC](https://forum.servoy.com/t/null-dates-bad-centuries-and-ireport/11316 "2009-10-23T15:05:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![msedita](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@msedita](https://forum.servoy.com/u/msedita)\
**Post date:** [October 23, 2009, 3:05pm UTC](https://forum.servoy.com/t/null-dates-bad-centuries-and-ireport/11316/1 "2009-10-23T15:05:46Z")

</div>

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:

```auto
... 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?

---

<div class="post-metadata">

**Author:** ![rgansevles](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@rgansevles](https://forum.servoy.com/u/rgansevles)\
**Post date:** [October 28, 2009, 8:12am UTC](https://forum.servoy.com/t/null-dates-bad-centuries-and-ireport/11316/2 "2009-10-28T08:12:42Z")

</div>

Michael,

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

Rob
