以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]请问数字或双精度小数查找怎么写??  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=144956)

--  作者:爱秦宣言
--  发布时间:2020/1/3 21:49:00
--  [求助]请问数字或双精度小数查找怎么写??
 请问数字或双精度小数查找怎么写??请大大们来解答~~

"长度","宽度","厚度"为双精度小数,不知道怎么写了

代码如下

Dim filter As String
Dim sts() As String = {"合同号","客户名称","业务员","长度","宽度","厚度","原料产地"}
For Each st As String In sts
    Dim  val As String = e.Form.Controls(st).value
    If val > "" Then
        val = val.Replace("*","[*]")
        If filter = "" Then
            filter = st & " like \'*" & val & "*\'"
        Else
            filter = filter & " and " & st & " like \'*" & val & "*\'"
        End If
    End If
Next


Tables("销售合同基础表").Filter = filter
[此贴子已经被作者于2020/1/3 21:51:36编辑过]

--  作者:有点蓝
--  发布时间:2020/1/3 22:09:00
--  
Dim filter As String
Dim sts() As String = {"合同号","客户名称","业务员","长度","宽度","厚度","原料产地"}
For Each st As String In sts
    Dim  val As String = e.Form.Controls(st).value
    If val > "" Then
        val = val.Replace("*","[*]")
if TTables("销售合同基础表").cols(st).IsNumeric then
st = "convert(" & st & ",\'System.String\')"
end if
        If filter = "" Then
            filter = st & " like \'*" & val & "*\'"
        Else
            filter = filter & " and " & st & " like \'*" & val & "*\'"
        End If
    End If
Next