VB6.0数据库两个日期间查询问题

Adodc1.RecordSource = "select * from 支出记录 where 支出日期" & ">=" & DTPicker2.Value & "and" & "支出日期" & "<=" & DTPicker3.Value & "'"
Adodc1.Refresh
Set DataGrid2.DataSource = Adodc1
DataGrid2.Refresh
说是问题在sql语句
求高手解决!!!

1 and 前后各加空格。2 去掉最后“‘”
Adodc1.RecordSource = "select * from 支出记录 where 支出日期" & ">=" & DTPicker2.Value & " and " & "支出日期" & "<=" & DTPicker3.Value
温馨提示:答案为网友推荐,仅供参考
第1个回答  2012-06-25
"select * from 支出记录 where 支出日期" & " >= " & DTPicker2.Value & " and " & "支出日期 " & "<= " & DTPicker3.Value & "order by 支出日期" 空格问题 每个元素都要有空格分割本回答被网友采纳
相似回答