0

有人可以帮忙编辑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是正确的;我已经检查过了。但我认为问题出在过滤日期..

4

1 回答 1

1

将您的查询更改为

"{tblTimeLog.dtr_name}='" & cboName.Text & "' and {tbltimelog.dtr_datelog}
in '" & DateValue(DateTimePicker1.Text) & "' to '" & 
DateValue(DateTimePicker2.Text) & "'"
于 2012-07-30T04:39:19.590 回答