Marc,

It isn't very elegant, but you could try using a native query with a
cast to produce the result.  I was able to get the native query below
to produce only Orders for the current date using DB2. My 'created'
field is defined as a TIMESTAMP, which is similar to the DATETIME
datatype.

@NamedNativeQuery(name="todaysOrders",
        query="select * from ORDER where CAST(created AS DATE) = current_date",
        resultClass=Order.class)

This is, of course, DB specific so it may or may not work for with
your DB (SQL Server?).  I've been searching for a means to do
something similar with JPQL but haven't found anything yet.

-Jeremy

Reply via email to