hi
i am in difficulty of writing a correct Date comparison hql query.
i have wrote the following query--
public Collection getPeriodicalApplicationList(Session session, Date fromDate, Date toDate) throws DaoException{
try{
String queryString = "from DeskProcessDto dto where dto.applicationDesk.applicationDateType between :param1 and :param2";
Query query = session.createQuery(queryString);
query.setString("param1", DateFormatter.getInstance().format(fromDate, DateFormatter.getInstance().DATE_PATTERN_DD_MMM_YY));
query.setString("param2", DateFormatter.getInstance().format(toDate, DateFormatter.getInstance().DATE_PATTERN_DD_MMM_YY));
return query.list();
}catch(HibernateException _hbx){
_hbx.printStackTrace();
throw new DaoException(_hbx);
}
}
but it is not giving me the desired result
please would any one tell me how can i get all the records which fall between two particular record
thanx
Samim
|