querying from and to dates
Posted: Fri Jan 16, 2009 12:08 am
I have a table with a datetime field.
Now i want to select rows between two specific dates.
Lets say from 27-11-08 to 16-01-09. I want the result to display all the entries within that period including the records that are entered on 16-01-09. I could not get a proper mysql query to do that. Can someone help me out with this one?
present code i am using to query is
Now i want to select rows between two specific dates.
Lets say from 27-11-08 to 16-01-09. I want the result to display all the entries within that period including the records that are entered on 16-01-09. I could not get a proper mysql query to do that. Can someone help me out with this one?
present code i am using to query is
Code: Select all
mysql_query("SELECT * FROM transactions WHERE
Time >'$from_date'
AND
Time<='$to_date'
AND
loginID = $loginID");