1 Reply Latest reply on Mar 10, 2005 6:34 PM by mary smith

    problem with query

    mary smith Newbie


      i've been trying to solve a problem for the last 2 days but i couldn't.

      what i want to do is having a method which returns the registers from the database that have the orderDate between two values. i use the query:

      SELECT OBJECT(d) FROM Orders d
       WHERE (d.orderDate BETWEEN ?1
       AND ?2)
       AND d.despatched = 0

      when i do so, the query is executed but just the registers with despatched=0 ar returned, no matter what value they have in the orderDate field.

      i always use java.sql.Date in the beans althouth i have already tried using java.util.Date and spliting the query to do it without using BETWEEN but even so, it doesn't return the correct values.

      i hope u can help me as i'm quite lost.