有人可以帮忙修改此RecordSelectionFormula
吗?这是一个错误,有日期格式...
数据库的日期值为:
data type = datetime (yyyy-mm-dd)
和
datetimepicker is formatdatetime(now,vbshortdate)
我的代码片段是:
"{tblTimeLog.dtr_name}='" & cboName.Text & "' and
{tbltimelog.dtr_datelog} Between '" & DateValue(DateTimePicker1.Text) &
"' AND '" & DateValue(DateTimePicker2.Text) & "'"
我的代码的第一行(dtr_name to cboname
)是正确的;我检查了一下。但我认为问题在于过滤日期..
答案 0 :(得分:1)
将您的查询更改为
"{tblTimeLog.dtr_name}='" & cboName.Text & "' and {tbltimelog.dtr_datelog}
in '" & DateValue(DateTimePicker1.Text) & "' to '" &
DateValue(DateTimePicker2.Text) & "'"