date « Fetch « JPA Q&A





1. HQL retrieve based on a date column    coderanch.com

how to write a HQL statement which retrieve record based on date part of a column only, not include time portion? I see some forums say using trunc() function, but I got sql grammar exception. 15:17:43,102 [Timer-1] ERROR JDBCExceptionReporter - 'trunc' is not a recognized function name. 15:17:43,542 [Timer-1] ERROR InitServlet - Exception in BackendTimerTask org.springframework.dao.InvalidDataAccessResourceUsageException: could not execu te query; ...

2. How to retrieve Data on the Basis on DATE Field    forum.hibernate.org

I have been trying to retrieve records from the database that match a certain date. For that i have using following query : query = session.createCriteria(Event.class) .add(Expression.eq("dateOfEvent", objDate)) .list(); where event is mine bean class objDate is of type java.util.Date (i have also tried it as java.sql.Date) and dateOfEvent maps to Date_of_event (of type DateTime) in the SQL Server 2000 database. ...

3. Retrieve record with latest date field?    forum.hibernate.org

4. HQL retrieve based on a date column    forum.hibernate.org

version: Hibernate-Version: 3.2.4.sp1 how to write a HQL statement which retrieve record based on date part of a column only, not include time portion? I see some forums say using trunc() function, but I got sql grammar exception. 15:17:43,102 [Timer-1] ERROR JDBCExceptionReporter - 'trunc' is not a recognized function name. 15:17:43,542 [Timer-1] ERROR InitServlet - Exception in BackendTimerTask org.springframework.dao.InvalidDataAccessResourceUsageException: could not ...