技术求教,以下查询的代码语法有误?
' rs11.Open "Select * from 数据 Where 设备编号='" & Combo1.Text & "' And 确认状态='" & Combo4.Text & "'and 提交日期 between '" & DTPicker1.Value & "' and '" & DTPicker2.Value & "' ", conn11, 3, 2
这句代码中,语法错误,请大神帮忙指出?
rs11.Open "Select * from 数据 Where 设备编号='" & Combo1.Text & "' And 确认状态='" & Combo4.Text & "'And 提交日期> '" & DTPicker1.Value & "' And 提交日期< '" & DTPicker2.Value & "' ", conn11, 3, 2 '这是 SQL Server 数据库的查询语句,Access 数据库对于日期查询是不同的。 rs11.Open "Select * from 数据 Where 设备编号='" & Combo1.Text & "' And 确认状态='" & Combo4.Text & "'And 提交日期> #" & DTPicker1.Value & "# And 提交日期< #" & DTPicker2.Value & "# ", conn11, 3, 2 '这是 Access 数据库的查询语句 '或 rs11.Open "Select * from 数据 Where 设备编号='" & Combo1.Text & "' And 确认状态='" & Combo4.Text & "'And 提交日期>= #" & DTPicker1.Value & "# And 提交日期<= #" & DTPicker2.Value & "# ", conn11, 3, 2
[此贴子已经被作者于2020-5-10 10:59编辑过]