开发者

Between Operator in Access

开发者 https://www.devze.com 2023-03-05 23:15 出处:网络
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:

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#
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号