Hi, I have a little problem. I have dates with different hours in my database, and I want to use the function to_date in order to only obtain the date but I don't know how?
Here my criteria:
DetachedCriteria criteria = DetachedCriteria.forClass(SomeClass.class);
criteria.add(Restrictions.between("date1", someDto
.getDate1(), someDto.getDate2()));
I tried to do this:
DetachedCriteria criteria = DetachedCriteria.forClass(SomeClass.class);
criteria.add(Restrictions.between("to_date(date1)", someDto
.getDate1(), someDto.getDate2()));
jojojo but it doesn't work :D.
Any idea?, Some hint?
Thank you very much.
PS: I'm using Oracle9i and java.util.Date
|