EJB-QL find query on date field without time

Discussions

EJB programming & troubleshooting: EJB-QL find query on date field without time

  1. Hi,

    I am using EJB2 and CMP beans, database Oracle8. I am having the problem with date comparison. In EJB-ql where condition, I am giving like this :

    select Object(c) from tableEJB where c.columnDate = ?1

    It is comparing against time also. Then it is not returning any results. I want to compare only date not the time part. Please any body help, how to resolve this.

    Thanks
    Sreeni




  2. I can't see anything in the ejb ql grammer which covers any soft of date handling:

    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/EJBQL5.html

    Looks like another ommision from ejb ql.

    Daniel.
  3. select Object(c) from tableEJB where c.columnDate between ?1 and ?2

    1 = 01/01/2002 00:00:00
    2 = 01/01/2002 23:59:59