gpt4 book ai didi

sql access如何返回日期之间

转载 作者:行者123 更新时间:2023-12-02 03:15:10 24 4
gpt4 key购买 nike

如何在 MS Access 中指定日期范围?下面的查询正确吗?我必须将 "2/1/2010" 放在引号中吗?或者我必须做类似 date(2/1/2010) 的事情吗?

SELECT [Occurrence Number] as Fld
FROM [Lab Occurrence Form]
WHERE [Practice Code]="ACCIM"
AND [1 0 Preanalytical (Before Testing)]="1.1 Specimen Mislabeled"
AND ([Occurrence Date] Between 2/1/2010 and 2/28/2010);

以下给出了类型不匹配

SELECT [Occurrence Number] as Fld FROM [Lab Occurrence Form] WHERE [1 0 Preanalytical (Before Testing)]="1.1 Specimen Mislabeled" AND [Occurrence Date] between "1/1/2009" and "2/2/2010";

最佳答案

ms-access 使用 Jet 引擎,该引擎使用 # 表示日期文字:

SELECT Orders.*
FROM Orders
WHERE Orders.OrderDate Between #3/1/96# And #6/30/96#;

关于sql access如何返回日期之间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3168529/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com