vb adodc控件sql查询中日期变量引用错误
DimcK1AsString,cK2AsStringPrivateSubCheck1_Click()IfCheck1=1ThencK1="and销售日期between#"...
Dim cK1 As String, cK2 As String
Private Sub Check1_Click()
If Check1 = 1 Then
cK1 = " and 销售日期 between #" & DTPicker2 & "# and #" & DTPicker3 & "#"
Else: cK1 = ""
End If
End Sub
Private Sub Check2_Click()
If Check2 = 1 Then
cK2 = " and 票据编号='" & Text5.Text & "'"
Else: cK2 = ""
End If
End Sub
Private Sub Command1_Click()
SPDATA.RecordSource = "select * from dp_xsjl where id>0" & cK1 & "" & cK2 & ""
SPDATA.Refresh
End Sub
运行报错 : # 附近有语法错误 展开
Private Sub Check1_Click()
If Check1 = 1 Then
cK1 = " and 销售日期 between #" & DTPicker2 & "# and #" & DTPicker3 & "#"
Else: cK1 = ""
End If
End Sub
Private Sub Check2_Click()
If Check2 = 1 Then
cK2 = " and 票据编号='" & Text5.Text & "'"
Else: cK2 = ""
End If
End Sub
Private Sub Command1_Click()
SPDATA.RecordSource = "select * from dp_xsjl where id>0" & cK1 & "" & cK2 & ""
SPDATA.Refresh
End Sub
运行报错 : # 附近有语法错误 展开
1个回答
TableDI
2024-07-18 广告
2024-07-18 广告
在上海悉息信息科技有限公司,我们深知Excel在数据处理中的重要作用。在Excel中引用不同工作表(sheet)的数据是常见的操作,这有助于整合和分析跨多个工作表的信息。通过在工作表名称前加上感叹号“!”,您可以轻松地引用其他工作表中的数据...
点击进入详情页
本回答由TableDI提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询