我有一个查询,我想从内部为DLookup设置查询参数:
查询checkDate_Count_ForDangerousTickets:
SELECT count(*) AS numRelatedTickets
FROM DangrousTicketList
WHERE DateValue(backUpDate)>=DateValue(StartDate) And DateValue(backUpDate)<=DateValue(EndDate)
GROUP BY backUpDate;
我通过dlookup
设置查询参数调用查询backUpDate
:
DLookUp("[numRelatedTickets]", "[checkDate_Count_ForDangerousTickets]", _
"[backUpDate]=" & Format("01-27-2013", "\#mm\/dd\/yyyy\#"))
我得到了错误:
Run-time Error '2471'
The expression you entered as a query parameter produced this error:
'backUpDate'
就好像由于backUpDate
某种原因没有设置查询参数一样。