以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  提示从字符窜到Long转换无效,也不知道哪的的问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=140121)

--  作者:scofields
--  发布时间:2019/8/29 19:52:00
--  提示从字符窜到Long转换无效,也不知道哪的的问题
 老师,下面这段代码老是提示从字段窜到Long转换无效,也不知道是哪的问题?!帮忙看一下,另外后面那么多个Filter,感觉太繁琐了,有没解决办法?!
=====此前代码省略......’
Dim y As Integer = nr("报表日期").Year 
    Dim m As Integer = nr("报表日期").Month 
    Dim f As Integer = nr("报表日期").Day 
    Dim dt1 As New Date(y, m, f) 
    Dim dt2 As New Date(y-1, m, f) 
    If nr("市场部") = ary(0) Then
        nr("本期沙子日销量") = DataTables("发货单").SQLCompute("sum(发货数量)", "出库日期 >= \'" & dt1 & "\'" And "区域ID = 1001 " And " 区域ID = 1026 "  And " 产品ID = 1 " And " 产品ID = 2 " And " 产品ID = 4 " And " 产品ID = 94 " And " 产品ID = 95 " And " 产品ID = 98 " )
    End If


--  作者:y2287958
--  发布时间:2019/8/29 21:43:00
--  
"出库日期 >= \'" & dt1 & "\' And 区域ID in(1001,1026) And 产品ID in(1,2,4,94,95,98)"