# Servoy 3.5.2: Can't search dates using SQL with PostgreSQL

**URL:** <https://forum.servoy.com/t/servoy-3-5-2-cant-search-dates-using-sql-with-postgresql/8321>\
**Category:** Classic Servoy\
**Created:** [October 28, 2007, 1:33pm UTC](https://forum.servoy.com/t/servoy-3-5-2-cant-search-dates-using-sql-with-postgresql/8321 "2007-10-28T13:33:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![swingman](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/swingman/32/4536_2.png) [@swingman](https://forum.servoy.com/u/swingman)\
**Post date:** [October 28, 2007, 1:33pm UTC](https://forum.servoy.com/t/servoy-3-5-2-cant-search-dates-using-sql-with-postgresql/8321/1 "2007-10-28T13:33:31Z")

</div>

```auto
var query = "SELECT book_id FROM books WHERE date_1 < ?";
var args = new Array()
args[0] = new Date();
controller.loadRecords(query,args);

```

This works fine when testing against a MySQL database. But when using PostgreSQL, it fails with an error

```auto
Error loading primary key data, Can't infer the SQL type to use for an instance of java.util.Date. Use setObject() with an explicit Types value to specify the type to use.
com.servoy.j2db.dataprocessing.DataException: Can't infer the SQL type to use for an instance of java.util.Date. Use setObject() with an explicit Types value to specify the type to use.

```

Test case submitted already.

---

<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 30, 2007, 9:13am UTC](https://forum.servoy.com/t/servoy-3-5-2-cant-search-dates-using-sql-with-postgresql/8321/2 "2007-10-30T09:13:13Z")

</div>

This issue is solved in 3.5.3, see my post in [http://forum.servoy.com/viewtopic.php?p=47061#47061](http://forum.servoy.com/viewtopic.php?p=47061#47061)

Rob

---

<div class="post-metadata">

**Author:** ![swingman](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/swingman/32/4536_2.png) [@swingman](https://forum.servoy.com/u/swingman)\
**Post date:** [October 30, 2007, 10:19am UTC](https://forum.servoy.com/t/servoy-3-5-2-cant-search-dates-using-sql-with-postgresql/8321/3 "2007-10-30T10:19:37Z")

</div>

Thanks Rob.

C.
