以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  显示数据类型错误,但不知道怎么纠正  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=3789)

--  作者:floor2
--  发布时间:2009/8/2 23:45:00
--  显示数据类型错误,但不知道怎么纠正
   Dim s1,s2,s3,sum1 As double
    s1 = DataTables("期初库存").Compute("Sum(重量)","[克重] = " & e.DataRow("克重")   and "[编号] = \'" & e.DataRow("编号") & "\'" and "[幅宽] = " & e.DataRow("幅宽"))
    s2 = DataTables("生产清单").Compute("Sum(重量)","[克重] = " & e.DataRow("克重")   and "[编号] = \'" & e.DataRow("编号") & "\'" and "[幅宽] = " & e.DataRow("幅宽"))
    s3 = DataTables("发货清单").Compute("Sum(重量)","[克重] = " & e.DataRow("克重")   and "[编号] = \'" & e.DataRow("编号") & "\'" and "[幅宽] = " & e.DataRow("幅宽"))
    sum1=s1+s2-s3
    e.Datarow("重量") =Sum1


库存表的一个计算公式,“克重”列改变时弹出窗口说 字符串 到long 转换无效,不知道代码哪里需要改动,谢谢。

--  作者:czy
--  发布时间:2009/8/3 0:39:00
--  
Dim s1,s2,s3 As double
Dim dr As DataRow = e.DataRow
Dim s As String = "[克重]  = " & dr("克重") & " And [编号] = \'" & dr("编号") & "\' And [幅宽] = " & dr("幅宽")
s1 = DataTables("期初库存").Compute("Sum(重量)",s)
s2 = DataTables("生产清单").Compute("Sum(重量)",s)
s3 = DataTables("发货清单").Compute("Sum(重量)",s)
dr("重量") = s1+s2-s3
[此贴子已经被作者于2009-8-3 0:41:43编辑过]