I wonder if someone can help me. I am querying an oracle database using the following EJB QL, SELECT OBJECT(e)FROM ReStores e WHERE "e.leases.expirationDate = '06-30-2006' which is built dynamically On execution I get the following message: java.sql.SQLException : ORA-01843: Not a valid month. The object being passed is a SimpleDateFormat type and I have formatted in various forms such as MM-dd-yyyy etc but still get the same error. I am new to EJB QL and Java as a whole. Thanks for your help. Leonard
It would probably be easier to pass in the date as a parameter. If you're using a constant/literal value for the date, it has to be the number of seconds since 01/01/1970 at 00:00:00 GMT (just like System.currentTimeMillis() returns time in "milliseconds since...").