Hi all.
I have an interesting situation; searching a Date field for my exact value fails, but including it in a range works.
I know this sounds like the usual beginner's date/time woes but I don't believe it is. The reason for the "Date/time precision" title is that I would like to know whether anyone can tell me to what precision a date/time value is stored in Access. And how it might be affecting my search. (I have spent some time fruitlessly searching TSDN.)
I haven't been able to find any way to display a date/time down to tenths of a second - only down to the second. But is that exactly what is stored? Because here's my weird situation... (note, just one example - seems to apply to
I have a field called TheTime. Field type is Date/Time. There is a record with the value "06/13/2007 07:51:00". (Though it's painful, I'll use U.S. format for consistency with the SQL). If I execute this query...
If I execute this query...
So as far as I can tell, the value must be somewhere between 07:51:00 and 07:51:01. This then raises a few questions, such as
I have an interesting situation; searching a Date field for my exact value fails, but including it in a range works.
I know this sounds like the usual beginner's date/time woes but I don't believe it is. The reason for the "Date/time precision" title is that I would like to know whether anyone can tell me to what precision a date/time value is stored in Access. And how it might be affecting my search. (I have spent some time fruitlessly searching TSDN.)
I haven't been able to find any way to display a date/time down to tenths of a second - only down to the second. But is that exactly what is stored? Because here's my weird situation... (note, just one example - seems to apply to
I have a field called TheTime. Field type is Date/Time. There is a record with the value "06/13/2007 07:51:00". (Though it's painful, I'll use U.S. format for consistency with the SQL). If I execute this query...
SELECT * FROM PerMinuteStats WHERE TheTime = #06/13/2007 07:51:00#
...it returns no records.If I execute this query...
SELECT * FROM PerMinuteStats WHERE TheTime Between #06/13/2007 07:51:00# And #06/13/2007 07:51:01#;
...it returns the record which I knew was there.So as far as I can tell, the value must be somewhere between 07:51:00 and 07:51:01. This then raises a few questions, such as
- How the heck do I find the exact record? Values like "07:51:00.9 " just produce a "syntax error" response.
- How can I see the exact value that's in it?
- How did it get there? (I'll be looking into this if and when it seems necessary).
- Am I totally on the wrong track?
Comment