Use EXTRACT to retrieve the date portion of a date/time value.
EXTRACT
Usage
The EXTRACT function is database independent, but requires database support
Examples
Example 3-5 shows how to use this JPQL extension.
Example 3-5 Using EXTRACT EQL
EXTRACT(YEAR, e.startDate)
See Also
For more information, see:
"JPQL" http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Querying/JPQL
http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Querying/JPQL