Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to compare 2 dates in a JPA QL query

chflbAug 13 2008 — edited Oct 31 2011
hello all,

how can i compare 2 dates in JPA QL ,?

my idea was to convert the dates to String, and i used 'to_char',
but i think it doesn't work in JPA QL;
this is my query(it works in oracle but not in java) :

Query q=em.createQuery("select sum(o.montant) from Operation o join o.codTransac t join o.codCaisse c where (t.sens='D')and (to_char(c.dateCaisse,'MM/DD/YYYY')=to_char(o.dateOp,'MM/DD/YYYY'))");

can some one help me?
thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 28 2011
Added on Aug 13 2008
2 comments
12,327 views