I will have a table with datetime column
Let’s name it TmStamp with data 01/01/2001 01:00:PM
there is another date column, Let’s name it RegDate with data 01/01/2001
I want to select data with that date.
So I write
SELECT * FROM TABLE WHERE RegDate>=#01/01/2001# and RegDate<=#01/01/2001#
I get data for 01/01/2001.
HOWEVER,
SELECT * FROM TABLE WHERE TmStamp >=#01/01/2001# and TmStamp <=#01/01/2001#
I get nothing
I will get data for 01/01/2001 only if I do like this..
SELECT * FROM TABLE WHERE TmStamp >=#01/01/2001# and TmStamp <=#02/01/2001#
Dates are in DD/MM/YYYY format.
Any idea why is that?
In MS Access a Date/Time field always has a Time component. The RegData field has time of 00:00:00 so Access is not displaying it to you and the following query will work
You first TmStamp query is actually running this
As the TmStamp field has times it will not show any results.
What you need to do for Date/Time fields with a time other than 00:00:00 is run this query