Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » JPQL query date/datetime problem
JPQL query date/datetime problem [message #667490] Fri, 29 April 2011 02:50 Go to next message
Eclipse UserFriend
Hi,

in MySQL table there is a field which contains datetime value. I need to compare this to only date value. Is there any solution in JPQL or I need to use native query?

Thanks
Re: JPQL query date/datetime problem [message #667915 is a reply to message #667490] Mon, 02 May 2011 14:38 Go to previous message
Eclipse UserFriend
The JPQL spec does not provide any date conversion functions, but EclipseLink does provide a FUNC() JPQL function that allows usage of database function calls. The database function you use would be specific to your database, such as DATEPART().

EclipseLink Expressions also define several date functions not currently supported in JPQL.

You could also query that the date-time is between two Timestamp from 0 to midnight, this should be the same as checking the date only.
Previous Topic:Avoiding N+One Selects and stale BatchValueHolders
Next Topic:Does flush() sync with the db or the L2 cache?
Goto Forum:
  


Current Time: Wed Jul 23 16:17:04 EDT 2025

Powered by FUDForum. Page generated in 0.03368 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top