数据库查询问题。在线等!

asdefwang asdefwang 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我做了一段查询程序,现在想加入时间查询,不知道怎么加,请高手赐教,我用的 是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
...全文

相关推荐

评论 2
收藏 已收藏
分享
返回顶部
asdefwang
Access 7,731 成员 28,797 内容