Hi im trying to get number of rows from table using Hibernate based on start and end Date but im Getting not a Valid Month error
Session session = sessionFactory.getCurrentSession();
startDate = "13-02-02 00:00:00";
endDate = "17-02-02 00:00:00";
try{
String hql = "select Count(*) from mytable where PERIOD_START_DATETIME between '"
+ startDate + "' AND '" + endDate + "'";
Query query = session.createQuery(hql);
long count=(long) query.uniqueResult();
return count;
} finally{
session.close();
}
This is my table description
Name NULL TYPE NAME NOT NULL VARCHAR2(255 CHAR) PERIOD_END_DATETIME NOT NULL TIMESTAMP(6) PERIOD_START_DATETIME NOT NULL TIMESTAMP(6) PROD_OFFER_TERM_TYPE_ID NOT NULL NUMBER(19)