views:

35

answers:

2

Is there an equvalent of SQL TEMEDIFF functionality in JPQL? Is that possible to query with JPQL to find the records in specific time range?

+1  A: 

Is there an equvalent of SQL TEMEDIFF functionality in JPQL?

Is this standard SQL? Any link?

Is that possible to query with JPQL to find the records in specific time range?

Did you try to use BETWEEN (or the semantic equivalent):

datetime_expression [NOT] BETWEEN datetime_expression AND datetime_expression 
Pascal Thivent
A: 

select p from Person p
where p.modifyTime > '2010-03-04 23:59:59'
and p.modifyTime < '2010-03-24 00:00:00'

rayd09