以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]筛选出问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=89981)

--  作者:zj6430
--  发布时间:2016/9/2 13:38:00
--  [求助]筛选出问题

楼主:

现在新设了一个窗口,用于筛选信息,命令如下:

Dim Filter As String
Dim dst As Table=Tables("历年绩效数据库")
With e.Form.Controls("TextBox2")
    If .Value IsNot Nothing Then
        Filter = "姓名= \'" & .Value & "\'"
     End If
End With
With e.Form.Controls("TextBox1")
    If .Value IsNot Nothing Then
        Filter = "工号= \'" & .Value & "\'"
End If
   End With
With e.Form.Controls("StartDate")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "日期 >= #" & .Value & "#"
      End If
End With
With e.Form.Controls("EndDate")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "日期<= #" & .Value & "#"
    End If
End With

If Filter > "" Then
    Tables("历年绩效数据库").Filter = Filter
End If

 

 

c出现如下错误:

该字符串未被识别为有效的 DateTime。有一个从索引 9 处开始的未知字。

怎么调整都不行!楼主指点指点


--  作者:狐狸爸爸
--  发布时间:2016/9/2 14:53:00
--  
检查一下控制面板的日期时间格式设置,其中短日期格式通常应该为: yyyy-MM-dd