回复 15# auto
上面这张图里面,是有2012-09-02这一天的数据的。
下面这一张,是点击查询2012-08-01 TO 2012-09-02的数据。
没有了2012-09-02的数据
代码如下:Func cheak2($Group3, $ListView1)
$cx_time_1 = GUICtrlRead($Input4)
If $cx_time_1 = "" Or @error = 1 Then GUISetState(@SW_ENABLE, $Form1)
$cx_time_2 = GUICtrlRead($Input5)
If $cx_time_2 = "" Or @error = 1 Then GUISetState(@SW_ENABLE, $Form1)
;MsgBox(0,"",$cx_time_1,2)
;MsgBox(0,"",$cx_time_2,3)
$addfld = ObjCreate("ADODB.Connection")
$RS = ObjCreate("ADODB.Recordset")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & $mdb_data_path & ";Jet Oledb:Database Password=" & $mdb_data_pwd) ;连接数据库
$RS.ActiveConnection = $addfld
$RS.Open("Select * From dy where shijian >= '"&$cx_time_1& "' AND shijian <= '"&$cx_time_2&"'");
GUICtrlSendMsg($ListView1, $LVM_DELETEALLITEMS, 0, 0)
While Not $RS.eof And Not $RS.bof
If @error = 1 Then ExitLoop
GUICtrlCreateListViewItem($RS.Fields(2).value & "|" & $RS.Fields(1).value & "|" & $RS.Fields(3).value, $ListView1)
$RS.movenext
WEnd
|