Forum Moderators: open
Hi all,
I apologise for this question cropping up again, but I cannot seem to find any threads that cover this particular question.
I have two date fields in my database table a from_date and a to_date the type is DATE and FORMAT is 0000-00-00 yyyy-mm-dd.
My action class that deals with setting up the query accepts the query as two strings in the format 0000-00-00 yyyy-mm-dd my sql query looks like this:
SELECT * from myTable WHERE from_date BETWEEN 'fromDate' AND 'toDate'
I cannot seem to get this to work. Do I have to pass the string dates in as DATE format?
Also how can I make the query also check the to_date?
If I have a deal on between 2006-05-01 (from_date) and 2006-06-31 (to_date) the above query would only check my from_date field and not to_date. I need to find all results between a date range.
I think I am way off what I am trying to do, can someone please help me out...
TIA,
-george