Hi All
Windows XPPro
Access 2002/2007
I've a series of tables with Date_Added & Date_Last_Updated fields; they are in Date/Time format.
Although it's handy to have hh:m:ss times recorded they are only really useful for display purposes. When it comes to searching for records 'created or updated since mm/dd/yyyy', I only want to search on the date portions.
Yikes! I had no idea what I'd just wandered into!!
I build SQL and apply it as a recordsource to a form using VB.
I originally used the BETWEEN #mm/dd/yyyy# method but it didn't return records that had time portions.
I then thought I'd use the LIKE #mm/dd/yyyy construct but same problem, didn't return records with time portions.
I then tried xxx >= #mm/dd/yyyy# AND xxx <= #dd/dd/yyyy# - great until searching on one day only!
I then came up with BETWEEN #mm/dd/yyyy 00:00:01# and #mm/dd/yyyy 23:59:59# - works fine but daren't risk missing records that are created at exactly 00:00:00 (Murphy's Law).
Anyone know how to do this reliably? - I know Date/Time is ultimately stored as a double so I've a horrible feeling I'm going to have to search on the integer parts of the date - and suffer the consequent syntax jollies!
Thanks
Windows XPPro
Access 2002/2007
I've a series of tables with Date_Added & Date_Last_Updated fields; they are in Date/Time format.
Although it's handy to have hh:m:ss times recorded they are only really useful for display purposes. When it comes to searching for records 'created or updated since mm/dd/yyyy', I only want to search on the date portions.
Yikes! I had no idea what I'd just wandered into!!
I build SQL and apply it as a recordsource to a form using VB.
I originally used the BETWEEN #mm/dd/yyyy# method but it didn't return records that had time portions.
I then thought I'd use the LIKE #mm/dd/yyyy construct but same problem, didn't return records with time portions.
I then tried xxx >= #mm/dd/yyyy# AND xxx <= #dd/dd/yyyy# - great until searching on one day only!
I then came up with BETWEEN #mm/dd/yyyy 00:00:01# and #mm/dd/yyyy 23:59:59# - works fine but daren't risk missing records that are created at exactly 00:00:00 (Murphy's Law).
Anyone know how to do this reliably? - I know Date/Time is ultimately stored as a double so I've a horrible feeling I'm going to have to search on the integer parts of the date - and suffer the consequent syntax jollies!
Thanks