+ -
当前位置:首页 → 问答吧 → VB 时间段查询

VB 时间段查询

时间:2011-09-19

来源:互联网

按日期查询ok
 Data2.RecordSource = "select 输出地点,检测日期,采集时间,运行状况,电压A,电压B,电压C,电流A,电流B,电流C from 检测电压电流 where 输出地点='" & DBCombo1.Text & "' and 检测日期 between" + Chr(35) + Str(DTPicker1.Value) + Chr(35) + "and" + Chr(35) + Str(DTPicker2.Value) + Chr(35) + "order by 检测日期"
按时间(hh:mm:ss)出错代码
Data2.RecordSource = "select 输出地点,检测日期,采集时间,运行状况,电压A,电压B,电压C,电流A,电流B,电流C from 检测电压电流 where 输出地点='" & DBCombo1.Text & "' and 采集时间 between" + Chr(35) + Str(DTPicker3.Value) + Chr(35) + "and" + Chr(35) + Str(DTPicker4.Value) + Chr(35) + "order by 采集时间" '时间格式(DTPicker4.Value)00:00:00

作者: T43Jason   发布时间: 2011-09-19

要从日期字段里截取时间部分,才能取到时间。
另外,between后面也要加空格,and后也要加空格。

作者: chinaboyzyq   发布时间: 2011-09-19

热门下载

更多