当前位置:编程学习 > VB >>

VB and SQL server 通配符问题

用VB and sQL server 做系统 下面代码是实现查询功能的   输入职工号和出勤日期,即可查询到该员工本天的出勤时间,精确到秒,出勤时间查询条件那里使用了通配符,但是有问题,请大神帮我改下 
If Len(Text4.Text) > 0 Then
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from 员工出勤表 where 职工号='" & Trim(Text4.Text) & "' and  出勤时间  like ' " & Trim(Text5.Text) & "  % ' "
Adodc1.Refresh

Else
 MsgBox ("请指定要查找人员的职工号!"), , ("提示")
End If
 PS:  输入 员工号:0001
       输入 出勤日期: 2012/5/7    (出勤日期只是LABEL的caption 值   表中为出勤时间)
       输出结果 员工号:0001 
              出勤时间:   2012/5/7   13:23:23   --------------------编程问答-------------------- 看看这个http://www.cnblogs.com/goed/archive/2011/11/15/2249985.html --------------------编程问答-------------------- Adodc1.RecordSource = "select * from 员工出勤表 where 职工号='" & Trim(Text4.Text) & "' and 出勤时间 between '"& text5.text & " 00:00:00' and '"& text5.text & " 23:59:59'"
补充:VB ,  基础类
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,