Hibernate (HQL) date function issue
Posted on 2012-09-11
I am trying to query some data from DB2 database by using HQL. Basically I am trying get previous day records.
The following where condition is working fine when i exceute in data studio (DB2 client/IDE).
where (DAYS(CREATE_TS) = DAYS(CURRENT_DATE - 1 DAY))
In database CREATE_TS column was defined as TIMESTAMP.
But the same thing is not working with HQL. i tried several ways, i am getting SQLCODE=-182, SQLSTATE=42816 (Explanation: A date, time, or timestamp expression not valid).
Can anyone help me with this please ?
Thanks in Advance.