[jboss-user] [EJB 3.0] - EJB-QL Convert timestamp to date

mikezzz do-not-reply at jboss.com
Tue Feb 13 17:31:55 EST 2007


Hi,

I have a enitity with a timestamp field, but would like to query it with a date value.  Is there a portable way to truncate a timestamp to a date within an ejb-ql query?

E.g. something that would be functionally equivalent to the following Postgres query.

SELECT * FROM foo WHERE date_trunc('day', foo.timestamp) = date '2007-03-01'

Regards,
Michael Barker.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4016073#4016073

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4016073



More information about the jboss-user mailing list