clahti2
Posts: 107
|
Posted: 02/09/2012, 1:35 PM |
|
Hello all:
I have a standard grid and search page, one of the grid fields is "last_updated" which is a DateTime field in the mysql database. I have a search field with date picker that returns only the date portion, not the time, I would like the search to find records for the given date regardless of the time it was updated. I think this should be easy but I seem to have a brain-fart.
Any help is greatly appreciated!
|
|
|
mamboBROWN
Posts: 1713
|
Posted: 02/10/2012, 7:23 AM |
|
clahti2,
simply create a query that has a field that converts the datetime field to a date field and search the date field.
|
|
|
clahti2
Posts: 107
|
Posted: 02/15/2012, 10:06 PM |
|
this is fixed, in the SQL you need to do something like
SELECT CONCAT(YEAR(last_update),"-",MONTH(last_update),"-",DAY(last_update)) AS date_only FROM foo
and tie the search param to that field, which does not actually have to be present in the grid.
|
|
|
|