問題描述
從訪問表單的文本字段傳遞開始和結束日期參數 (Pass start and end date parameter from text field of access form)
我正在使用 MS Access 2016,我正在嘗試將開始和結束日期參數傳遞給查詢,例如:=>[start date] & <= [結束日期]
我需要的是,如果我將任何日期留空,例如開始或結束,我需要從該開始日期開始的所有日期或直到結束日期的所有日期.
參考解法
方法 1:
Simply include an or is null
branch to your query selection criteria, e.g.:
select * from YourTable
where
(YourDate >= Forms![Your Form]![Start Date] or Forms![Your Form]![Start Date] is null) and
(YourDate <= Forms![Your Form]![End Date] or Forms![Your Form]![End Date] is null)