我在Access中运行查询时收到错误,指出我的表达式不正确或太复杂。我试图在DateValue
表达式上使用参数 [Report Date] 过滤查询。查询在没有参数的情况下运行,当然未经过滤。如果我创建一个表并使用参数编写一个新查询,它将工作,但这需要每天运行,这似乎很麻烦。语法如下:
SELECT tbl_ReturnedEquipment.DateProgrammed, DateValue([tbl_ReturnedEquipment]![DateProgrammed]) AS Expr1, tbl_ReturnedEquipment.CSID, tbl_ReturnedEquipment.NewID
FROM tbl_ReturnedEquipment
WHERE (((DateValue(tbl_ReturnedEquipment!DateProgrammed))=[Report Date]) And ((tbl_ReturnedEquipment.NewID) Is Not Null) And ((tbl_ReturnedEquipment.EquipType)=2));