I tried to open a RecordSet in Access with the following query but I get a syntax error every time.
SELECT FromDate
, UntilDate
, NotificationText
,NotificationDetail
FROM ChangeNotification
WHERE FromDate <= #" & Date & "# AND
UntilDate >=#" & Date & "#"
The Date notation is in 22.11.2018
because apparently it's localized and I didn't find a way to undo it.
Do you know a way to execute the query anyway?
Thanks alot
答案 0 :(得分:1)
如果Date
是相同的VBA过程,则可以使用以下方法:
SELECT FromDate, UntilDate, NotificationText, NotificationDetail FROM ChangeNotification WHERE FromDate <= Date() AND UntilDate >= Date()
我还假定表中的字段FromDate
和UntilDate
的数据类型为Date/Time
。