This topic is locked

Searching by date-time

4/24/2007 1:56:25 PM
PHPRunner General questions
hax0r author

Hey dudes, ladies (Jane), and other phprunner's
I just downloaded 4.0 version 229 to see if it solved my problem, but I am still having trouble
I have a datetime field in my database. In the SQL statement i do a SELECT DATE(field) AS `Date` FROM table. On my List page I format this as a Short Date. And on the Search page it's listed as a Date with a "Simple edit box with datepicker".
Now say I have a few records dated 2/9/2007. I go to advanced search, click the calendar and search for rows equal to 2/9/2007. This returns 0 results! Why can't I use equals when searching for a Date??
Thanks in advance!!

kujox 4/24/2007

I have a datetime field in my database. In the SQL statement i do a SELECT DATE(field) AS `Date` FROM table. On my List page I format this as a Short Date. And on the Search page it's listed as a Date with a "Simple edit box with datepicker".

Now say I have a few records dated 2/9/2007. I go to advanced search, click the calendar and search for rows equal to 2/9/2007. This returns 0 results! Why can't I use equals when searching for a Date??


I don't know if this will help, just try and put the date in mysql format ie:2007-09-02 and see if you get results, the simple search may not swap the date format and do a direct compare in the mysql select statement

hax0r author 4/24/2007



I don't know if this will help, just try and put the date in mysql format ie:2007-09-02 and see if you get results, the simple search may not swap the date format and do a direct compare in the mysql select statement


Good thought Kujox, but no luck. I tried explicitly giving the format with DATE_FORMAT(field, '%Y-%d-%m') and on the list page I tried it with the Short Date format and without. But the advanced search still returned 0 rows when trying to match on Equals.

J
Jane 4/25/2007

Hi,
it's difficult to tell you what's happening without seeing actual files.

Please publish your project on Demo Account and send to [email=support@xlinesoft.com]support@xlinesoft.com[/email] a URL to your pages along with instructions on reproducing this error.

I'll find what's wrong with your project inspecting it at Demo account site.