This topic is locked

Search records by date

3/22/2010 2:14:51 AM
PHPRunner General questions
E
ezeuba author

In my application I have a field for date and time of entry where one can select a date and the time and this field is inserted into the database. Now i have tried to search for records using this date field but I get all kinds of errors. It can only display records if i search by the year, or the date but never by the month. I initially set this date_time field to display as longdate and it did not help issues, then I switched to using datetime and still when I search using the date field I get no records. What could be responsible for this and how do i fix it? In the database (mysql), I used the DATETIME data type.

Sergey Kornilov admin 3/22/2010

If you need to search by date I recommend to split date and time values into two separate fields.