datediff « SQL « JPA Q&A

1. Hibernate Dialects + datediff function

I have a problem in that the syntax for datediff in mysql is different from that in hsqldb:

mysql: datediff(date1,date2)
hsqldb: datediff(interval,date1,date2)
The dialects in hibernate usually resolve these issues, however I don't seem ...

2. datediff and native sql

Author Message jamesjmp Post subject: datediff and native sql Posted: Tue Apr 15, 2008 5:49 am Newbie Joined: Tue Apr 15, 2008 5:36 am Posts: 2 Hi, Im using Sybase, Hibernate and Seam. My queries are via HQL (no criteria) In native sql I have this query: (it works) Code: select datediff(day, '12/12/2007 14:47:11', '12/12/2007 14:19:07') 1.- I have ...