如何在MS Access中指定日期范围?以下查询正确吗?我必须加"2/1/2010"引号吗?还是我必须做类似的事情date(2/1/2010)?
"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#;