数据库查询问题。在线等!
我做了一段查询程序,现在想加入时间查询,不知道怎么加,请高手赐教,我用的 是framel,我在里面加入时间文本框,入年,月,日。然后在里面写入我想查询的时间,同时
三个合同号and班组and时间相于查询。下面程序是我的合同号和班组两个相于查询。
Dim Gconn As New ADODB.Connection
Dim RsField As ADODB.Recordset
Dim MaTable As String
Dim Num As Long
Dim BaseConn As String
Dim ChaineConn As String
Private Sub cnd1_Click()
dbString = App.Path & "\" & Trim(t1) & ".mdb"
If Dir(dbString) = "" Then
MsgBox "ºÏͬºÅÊäÈë´íÎó£¬ÇëÖØÊÔ", vbInformation, "ad"
Exit Sub
End If
Dim lstrSQL As String
Dim aa As String
listview1.ListItems.Clear
lstrSQL = "" '¶¨ÒåÊý¾Ý¿âºÍ°à×é²éѯ
aa = "" '¶¨ÒåÊý¾Ý¿âÃû×Ö²éѯ
lstrSQL = lstrSQL & "select productinf.*,pipes.* From productinf,pipes "
aa = aa & "select productinf.*,pipes.* From productinf,pipes "
If Trim(c1) = "ËùÓÐ" Then
lstrSQL = aa & "Where (ProductInf.ºÏͬºÅ = '" & t1.Text & "' ) And Pipes.ID=ProductInf.ID"
Else
lstrSQL = aa & "Where (ProductInf.ºÏͬºÅ = '" & t1.Text & "') And (Pipes.°à×é = '" & c1.Text & "') And Pipes.ID=ProductInf.ID"
End If
三个合同号and班组and时间相于查询。下面程序是我的合同号和班组两个相于查询。
Dim Gconn As New ADODB.Connection
Dim RsField As ADODB.Recordset
Dim MaTable As String
Dim Num As Long
Dim BaseConn As String
Dim ChaineConn As String
Private Sub cnd1_Click()
dbString = App.Path & "\" & Trim(t1) & ".mdb"
If Dir(dbString) = "" Then
MsgBox "ºÏͬºÅÊäÈë´íÎó£¬ÇëÖØÊÔ", vbInformation, "ad"
Exit Sub
End If
Dim lstrSQL As String
Dim aa As String
listview1.ListItems.Clear
lstrSQL = "" '¶¨ÒåÊý¾Ý¿âºÍ°à×é²éѯ
aa = "" '¶¨ÒåÊý¾Ý¿âÃû×Ö²éѯ
lstrSQL = lstrSQL & "select productinf.*,pipes.* From productinf,pipes "
aa = aa & "select productinf.*,pipes.* From productinf,pipes "
If Trim(c1) = "ËùÓÐ" Then
lstrSQL = aa & "Where (ProductInf.ºÏͬºÅ = '" & t1.Text & "' ) And Pipes.ID=ProductInf.ID"
Else
lstrSQL = aa & "Where (ProductInf.ºÏͬºÅ = '" & t1.Text & "') And (Pipes.°à×é = '" & c1.Text & "') And Pipes.ID=ProductInf.ID"
End If
...全文
相关推荐
Thinkphp数据库在线备份下载和还原代码
Thinkphp数据库在线备份下载和还原代码,使用ThinkPHP框架
管理员可以在首页在线列表看见隐身的会员插件 for Discuz!7.0.rar
让管理员可以在首页在线列表看见隐身的会员
8e数据 16e数据库 数据在线查询
8e16e数据库 16e数据已做高压缩处理到5.25GB,解压后是17.9GB 内存不足打不开,请换其他工具打开!任何txt工具都可以尝试打开。
idea中database不显示问题的解决
主要介绍了idea中database不显示问题的解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
NBA球员数据管理系统数据库课程设计
NBA球员数据管理系统数据库课程设计


