vb改错,时间查询语句

来源:百度知道 编辑:UC知道 时间:2024/05/22 18:39:24
Adodc1.RecordSource = "select * from 表1 where AlarmTime)> #" & DTPicker1.Value & "# And AlarmTime < #" & DTPicker2.Value & "#
控件DTPicker显示的是时间,表中 ALarmTime是时间如15:00:00

Adodc1.RecordSource = "select * from 表1 where AlarmTime)> #" & DTPicker1.Value & "# And AlarmTime < #" & DTPicker2.Value & "#

AlarmTime)> 为啥会有括号...AlarmTime>
AlarmTime这个要在数据库里有...而且为时间字段..

以下做为参考...
VSFlexGrid1.Rows = 1
'VSFlexGrid1.Redraw = flexRDBuffered
Msql = "select rxsj,sqr,xybm,zjhm,bmf,phone,cx,pxfs,address,tjr,zt from txyda where rxsj >='" & DTPicker1.Value & "' and rxsj<='" & DTPicker2.Value & "' and zt<>'撤消'"
Call InsertData(Msql)
Msqlb = "select sum(zje) as fkjex from txyda where rxsj >='" & DTPicker1.Value & "' and rxsj<='" & DTPicker2.Value & "' and zt<>'撤消'"
Call inserthj(Msqlb)
VSFlexGrid1.ZOrder 0