I'm running a query that selects data from a table and this table has 2 columns with a begindate and a enddate.
Now I want to do a select that select all rows where a given date must be between the begindate and the enddate, however when the given date is the same as the begindate and the enddate it returns nothing !!
The time of the given date is 12:00, the time of begindate is 10:00 and that of the enddate 23:00. So it should return my rows !!
No way it does !!!
My query is runned from Hibernate but also when I do the same in SQuireL SQL it goes wrong.
It looks something like this:
Calendar base = Calendar.getInstance(Constants.NL_LOCALE);
base.set(2007, Calendar.FEBRUARY, 26, 12, 00);
Session session = HibernateHelper.getSession();
String qString = "SELECT * FROM MyTable WHERE :mydate BETWEEN MyTable.begindate AND MyTable.enddate";
:dag <= MyTable.begindate AND :dag >= jaarplanactiviteit.MyTable.enddate
Does not do this right......
What is going on here, anyone a clue ??