Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[求助]筛选条件出错

1楼
lgj716330 发表于:2024/10/28 21:07:00
Dim FtNY As String
Dim ayf As WinForm.RadioButton = e.form.Controls("按月份")
Dim arq As WinForm.RadioButton = e.form.Controls("按日期")
Dim NY1, NY2 As Integer
Dim NY3 As String
NY1 = e.form.Controls("QZNY1").value
NY2 = e.form.Controls("QZNY2").value
NY3 = e.form.Controls("PCNY").value
If ayf.Checked = True Then
    If ny3.Length > 0 Then
        FtNY = "年月 >= " & NY1 & " and 年月 <= " & NY2 & " and 年月 Not in (" & ny3 & ")"
    ElseIf ny3 = "" Then
        FtNY = "年月 >= " & NY1 & " and 年月 <= " & NY2 & ""
    End If
ElseIf arq.Checked = True Then
    FtNY = "日期 >= '" & rq1 & "' and 日期 <= '" & rq2 & "'"
End If
msgbox(FtNY)

上面绿色部分执行没问题,黄色部分提示以下错误,把条件去掉单单执行FtNY = "年月 >= " & NY1 & " and 年月 <= " & NY2 & ""也是没有问题,有点晕

图片点击可在新窗口打开查看此主题相关图片如下:微信图片_20241028210500.png
图片点击可在新窗口打开查看


2楼
lgj716330 发表于:2024/10/28 21:14:00
哦,解决了,条件倒转一下就没问题了
共2 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .02734 s, 2 queries.