Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to obtain CURDATE() / NOW() on a JPA named query?

Tags:

I want to do a select from table where date = TODAY, on mysql that would be where date > CURDATE(), how do I do this on a JPA named query?

like image 821
albemuth Avatar asked Sep 30 '09 20:09

albemuth


1 Answers

From the spec:

4.6.16.3 Datetime Functions

functions_returning_datetime:= CURRENT_DATE | CURRENT_TIME | CURRENT_TIMESTAMP 

The datetime functions return the value of current date, time, and timestamp on the database server.

like image 185
McDowell Avatar answered Oct 24 '22 20:10

McDowell