can anyone tell me how to select data by date in MS.ACCESS database using PHP?
I’m trying to select data for example (absent = 14/06/2012 13:00:00) using a wildcard (absent = 14/06/2012*)
Here are my query
$sql = "SELECT TOP 1 * FROM absent WHERE id = $id AND absent LIKE '#14/06/2012#'"
$result = odbc_exec($connect, $sql);
absent field have a Date (General Date) Type. while id = AutoNumber.
I got no result, using that query. Where is my mistake?
already trying this
absent = #14/06/2012#
absent = '14/06/2012*'
but not success.
EDIT
Well, i have succedd but not using a wild card. Here are my solution, I’m using a range date to limit the search
WHERE absent >= #14/06/2012 AND absent < #15/06/2012#;
Damn you Ms-Access!
I can’t try my answers, since I don’t have php available, but here are a few ideas
(assuming that Absent is a Date field).
'or"otherwise you will get a divisionThere fore my guess would be
absent LIKE '06/04/2012*'Other – perhaps less efficient, but safer – criteria could be:
or
Good luck