I need to make a finder for some entities by date. I wanted to declare findInDateRange(Date startDate, Date endDate) with ejb-ql: select distinct(o) from myEntity as o where o.caseDate between ?1 and ?2 IT DOESN'T WORK. I see very similar example in J2EE tutorial... JBoss is screaming: between found when >, <,... expected. So I tried to change query to: from o.caseDate>=?1 and o.caseDate<=?2 IT ALSO DOESN'T WORK (the same reason). What's going on? How to solve it?