Access 中的操作员之间

发布于 2024-11-07 05:51:43 字数 452 浏览 3 评论 0原文

我正在研究 Access 数据库。我正在尝试编写一个查询来让用户选择开始日期和结束日期。以下是设计视图中条件下的查询:

Between [Enter Date From(mm/dd/yyyy)] And [Enter Date to(mm/dd/yyyy)]

After 04/01/2011 and 05/12/2011 输入但是,Access 数据库中的结果与以下查询中的结果不同。

SELECT SOMETHING
FROM MY TABLE
WHERE SOLD_DATE >=04/01/2011'
AND SOLD_DATE <'05/13/2011'

访问:16,564 条记录

MS 查询:16,573 条记录

我猜这是假定的时间为上午 12 点。如何让查询包含一直到晚上 11:59 的结束日期?

非常感谢!

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 date all the way to 11:59 PM?

Thanks much!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

半暖夏伤 2024-11-14 05:51:43

它们不是同一个查询。你应该包括两个极端:

SELECT SOMETHING
FROM MY TABLE
WHERE SOLD_DATE >='04/01/2011'
AND SOLD_DATE <='05/13/2011'

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'
哥,最终变帅啦 2024-11-14 05:51:43

但日期请在 # 之间。

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#
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文