Foxtable(狐表)用户栏目专家坐堂 → 请问老师,查询窗口的年和月代码怎么写


  共有2503人关注过本帖平板打印复制链接

主题:请问老师,查询窗口的年和月代码怎么写

帅哥哟,离线,有人找我吗?
jingledyang
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:55 积分:479 威望:0 精华:0 注册:2019/4/13 17:35:00
  发帖心情 Post By:2019/6/24 23:33:00 [只看该作者]

老师代码运行错误

.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2019.6.13.1
错误所在事件:
详细错误信息:
语法错误:“工作日期”运算符后缺少操作数。

 

代码错误:

Dim Filter As String
With e.Form.Controls("ComID")
    If .Value IsNot Nothing Then
        Filter = "注册码 = '" & .Value & "'"
    End If
End With
With e.Form.Controls("ComNm")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter  &="姓名 = '" & .Value & "'"
    End If
End With
With e.Form.Controls("ComLtd")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter &= "公司名称 = '" & .Value & "'"
    End If
End With
Dim y As Integer = val(e.form.controls("yDate").text)
Dim m As Integer = val(e.form.controls("mDate").text)
If y > 0
    If m > 0 Then
        Dim d As Date = new Date(y,m,1)
        Filter = Filter & "工作日期 >= #" & d & "# and 工作日期 < #" & d.AddMonths(1) & "#"
    Else
        Dim d As Date = new Date(y,1,1)
        Filter = Filter & "工作日期 >= #" & d & "# and 工作日期 < #" & d.AddYears(1) & "#"
    End If
End If
Tables("考勤日记").Filter = Filter


 回到顶部
总数 13 1 2 下一页