I am working on an Access database. I am trying to write a query to let the user select the start and end dates. Here is the query in design view under Criteria:
Between [Enter Date From(mm/dd/yyyy)] And [Enter Date to(mm/dd/yyyy)]
After 04/01/2011 and 05/12/2011 were entered, however, the result in the Access database is not the same as in the below query.
SELECT SOMETHING
FROM MY TABLE
WHERE SOLD_DATE >=04/01/2011'
AND SOLD_DATE <'05/13/2011'
Access:16,564 records
MS query: 16,573 records
I guess it's the time assumed to be 12 AM. How can I get the query to include the end开发者_JAVA技巧 date all the way to 11:59 PM?
Thanks much!
They are not the same query. You should include both extremes:
SELECT SOMETHING
FROM MY TABLE
WHERE SOLD_DATE >='04/01/2011'
AND SOLD_DATE <='05/13/2011'
But dates between # please.
SELECT SOMETHING
FROM MY TABLE
WHERE SOLD_DATE >= #04/01/2011#
AND SOLD_DATE <= #05/13/2011#
精彩评论