我得到一个"表达式输入不正确,或者太复杂而无法评估"尝试在访问2016中使用datevalue()
函数和日期/时间字段时出错。
以下是我尝试使用的查询的代码。
如果我将参数切换为实际日期值,那么在尝试执行查询时会出现数据不匹配错误消息。关于这个问题的任何想法可能是什么?
SELECT
dbo_vTTSTMW_ResourceMileage.[Driver1 ID],
dbo_vTTSTMW_ResourceMileage.[Driver1 Name],
dbo_vTTSTMW_ResourceMileage.[Order Header Number],
dbo_vTTSTMW_ResourceMileage.[Total Miles],
dbo_vTTSTMW_ResourceMileage.[Empty Miles],
dbo_vTTSTMW_ResourceMileage.[Loaded Miles],
DateValue([Segment Start Date]) AS [Order Date]
FROM
dbo_vTTSTMW_ResourceMileage
GROUP BY
dbo_vTTSTMW_ResourceMileage.[Driver1 ID],
dbo_vTTSTMW_ResourceMileage.[Driver1 Name],
dbo_vTTSTMW_ResourceMileage.[Order Header Number],
dbo_vTTSTMW_ResourceMileage.[Total Miles],
dbo_vTTSTMW_ResourceMileage.[Empty Miles],
dbo_vTTSTMW_ResourceMileage.[Loaded Miles],
DateValue([Segment Start Date])
HAVING
(((DateValue([Segment Start Date]))>=[start date] And (DateValue([Segment Start Date]))<=[end date]));