帮忙看看代码怎么改
Dim stime As String
If ruku.Value Then
stime = "and 交库日期 between #" & op.Month & "/" & op.Day & "/" & op.Year & "# and #" & dtEnd.Month & "/" & dtEnd.Day & "/" & dtEnd.Year & "#"
Else
stime = ""
End If
以上代码在access数据库中可以执行,为什么在sql数据库中执行不了
[解决办法]
stime = "and datediff(day,[交库日期],'"& format(op,"yyyy-MM-dd") &"')<=0 and datediff(day,[交库日期],'"& format(dtEnd,"yyyy-MM-dd") &"')>=0