Foxtable(狐表)用户栏目专家坐堂 → 下面这段代码 执行起来 速度很慢 要等待 帮忙看一下 谢谢


  共有2353人关注过本帖树形打印复制链接

主题:下面这段代码 执行起来 速度很慢 要等待 帮忙看一下 谢谢

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


加好友 发短信
等级:九尾狐 帖子:2552 积分:20057 威望:0 精华:0 注册:2012/5/19 11:57:00
下面这段代码 执行起来 速度很慢 要等待 帮忙看一下 谢谢  发帖心情 Post By:2023/8/30 12:17:00 [显示全部帖子]

下面这段代码 执行起来 速度很慢 要等待 帮忙看一下 谢谢
''''
Dim exp As String  = "1=1"
Dim sq1 As String="selec 套数,入库, 出库,(isnull(套数,0)-isnull(出库,0)) as 结存, a.* from (SELEC * FROM 订单) a left join("
Dim sq2 As String="Selec  订单号, sum(入库) As 入库, sum(出库) As 出库 from (Selec 订单号, 数量 As 入库, 0 As 出库 from {成品入库单明细}  where " & exp & ""
'Dim sq3 As String="union all Selec 产品编码,0, 盈亏数量  from {盘点单明细} where " & exp & ""
'Dim sq4 As String="union all Selec 产品编码,0, 数量  from {调拨单明细} where " & ck1 & ""
'Dim sq5 As String="union all Selec 产品编码,数量, 0  from {调拨单明细} where " & ck2 & ""
Dim sq6 As String="union all Selec 订单号,0,数量  from {成品出库单明细} where " & exp & ") As d  group by 订单号) As b  on a.订单号 = b.订单号"
Tables(e.form.Name & "_Table1").fill(sq1 &sq2 &sq6,"wjhansdata",True)
Tables(e.form.Name & "_Table1").SetColVisibleWidth("订单号|98|日期|100|周别|180|订单PO号|180|成品料号|200|工令|180|套数|90|入库|90|出库|90|结存|128|")
 Tables(e.form.Name & "_Table1").DefaultRowHeight = 23
 Tables(e.form.Name & "_Table1").DataTable.AllowResizeRow=False
If Tables(e.form.Name & "_Table1").rows.count=0
    Tables(e.form.Name & "_Table1").GrandTotal = False
Else
    Tables(e.form.Name & "_Table1").Cols("出库").GrandTotal = True
    Tables(e.form.Name & "_Table1").Cols("入库").GrandTotal = True
    Tables(e.form.Name & "_Table1").Cols("结存").GrandTotal = True
    Tables(e.form.Name & "_Table1").Cols("套数").GrandTotal = True
    Tables(e.form.Name & "_Table1").GrandTotal = True '显示合计模式
End If

 回到顶部