Foxtable(狐表)用户栏目专家坐堂 → 筛选一个时间段到统计表1


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

主题:筛选一个时间段到统计表1

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


加好友 发短信
等级:幼狐 帖子:154 积分:1331 威望:0 精华:0 注册:2017/10/8 14:56:00
  发帖心情 Post By:2017/10/26 16:19:00 [只看该作者]

Dim Filter As String

Dim a = e.Form.Controls("TextBox1").Text
Dim b = e.Form.Controls("TextBox2").Text


With e.Form.Controls("TextBox1")
    If .value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "convert(" & a & ",'System.String') Like '%" & .text & "%'"
    End If
End With

With e.Form.Controls("TextBox2")
    If .value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "convert(" & b & ",'System.String') Like '%" & .text & "%'"
    End If
End With

With e.Form.Controls("DateTimePicker1")
    If .value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "convert(工作日期,'System.DateTime') >= '#" & .text & "#'"
    End If
End With

With e.Form.Controls("DateTimePicker2")
    If .value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "convert(工作日期,'System.DateTime') <= '#" & .text & "#'"
    End If
End With

If Filter > "" Then
    Tables("工时").Filter = Filter
End If

这样写之后  还是出date 到decimal 转换无效

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