This topic is locked

Searching by date field created with 'now()'

10/16/2005 5:44:05 PM
ASPRunnerPro General questions
G
giffenf author

I have a table with a "Date Changed" field in it, which is set to automatically update every time the record is edited by using "now()" in the Edit Format and making the field a hidden field.
When a user attempts to search by this date using the "contains," "equals" or "starts with" operators, it yields nothing if they enter in the entire date. If, however, they use "more than," or "equal to or more than," it finds all the records. If they use "Starts with" and enter the month and day with two slashes (e.g., "10/16/"), it finds all the records, but not if they use the full date (e.g., "10/16/2005"). Am I doing something wrong here?
Thanks,
FG

Sergey Kornilov admin 10/17/2005

MS Access stores data values in binary format. You can only expect date search/comparisson to work when you use one of date picking controls on the advanced search page.
Here is article that explains this with greater details:

http://support.microsoft.com/default.aspx?...kb;en-us;210276

Because dates and times are stored together as double-precision numbers, you may receive unexpected results when you compare Date/Time data.

G
giffenf author 10/19/2005

Fair enough. Thanks!
FG