0

I'm trying to query an exact date without time, is there a way to do this? Example, return all records that have the date 2013-11-06.

I've tried the following, but I think it's failing do to the time piece of the date.

//Preset calendar date. 
Date searchDate = obj.searchDate();

session.criteriaQuery(TimeSheet.class).add(Restrictions.eq("createDate", searchDate )).list();
Code Junkie
  • 7,602
  • 26
  • 79
  • 141
  • 2
    possible duplicate of [Using HQL to query on a date while ignoring the time on Oracle](http://stackoverflow.com/questions/980366/using-hql-to-query-on-a-date-while-ignoring-the-time-on-oracle) – OldProgrammer Dec 30 '13 at 18:50
  • @OldProgrammer I assumed that was going to be the only way to handle this. I guess I was hoping for something simpler. Thanks. – Code Junkie Dec 30 '13 at 18:52

0 Answers0