Foxtable(狐表)用户栏目专家坐堂 → 订单交期统计问题


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

主题:订单交期统计问题

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/7/11 9:21:00 [显示全部帖子]

Dim yf As WinForm.TextBox = e.Form.Controls("月份")
Dim aqs As WinForm.TextBox = e.Form.Controls("按期数")
Dim cqs As WinForm.TextBox = e.Form.Controls("超期数")
Dim dds As WinForm.TextBox = e.Form.Controls("订单数")
Dim zjl As WinForm.TextBox = e.Form.Controls("准交率")

Dim dt As DataTable = DataTables("表A")
Dim filter As String = "月 = '" & yf.text & "'"
dds.text = dt.Compute("count(订单编号)", filter)
aqs.text = dt.Compute("count(订单编号)", filter & " and 完工='按期'")
cqs.text = dt.Compute("count(订单编号)", filter & " and 完工='超期'")
zjl.text = format(aqs.text / dds.text, "0.00%")


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/7/11 10:02:00 [显示全部帖子]

dds.text = dt.Compute("count(订单编号)", filter & " and 完工 is not null")
[此贴子已经被作者于2017/7/11 10:19:27编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/7/11 10:19:00 [显示全部帖子]

dds.text = dt.Compute("count(订单编号)", filter & " and 完工 is not null")

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/7/25 12:15:00 [显示全部帖子]

Dim yf As WinForm.TextBox = e.Form.Controls("月份")

'品种准交率
Dim pzaqs As WinForm.TextBox = e.Form.Controls("品种按期数")
Dim pzcqs As WinForm.TextBox = e.Form.Controls("品种超期数")
Dim pzs As WinForm.TextBox = e.Form.Controls("品种数")
Dim pzzjl As WinForm.TextBox = e.Form.Controls("品种准交率")
Dim ddaqs As WinForm.TextBox = e.Form.Controls("订单按期数")
Dim ddcqs As WinForm.TextBox = e.Form.Controls("订单超期数")
Dim dds As WinForm.TextBox = e.Form.Controls("订单数")
Dim ddzjl As WinForm.TextBox = e.Form.Controls("订单准交率")


Dim dt As DataTable = DataTables("表A")
Dim filter As String = "月 = '" & yf.text & "'"
Dim aq As Double = 0
Dim cq As Double = 0
Dim dd As Double = 0
For Each ddh As String In dt.GetValues("订单编号", filter & " And 完工 Is not null")
    Dim count As Double = dt.compute("count(订单编号)", "订单编号 = '" & ddh & "' and 完工 = '超期'")
    If count > 0 Then
        cq += 1
    Else
        aq += 1
    End If
    dd += 1
Next
ddaqs.text = aq
ddcqs.text = cq
dds.text = dd
ddzjl.text = format(ddaqs.text / dds.text, "0.00%")

pzs.text = dt.Compute("count(订单编号)", filter & " And 完工 Is not null")
pzaqs.text = dt.Compute("count(订单编号)", filter & " and 完工='按期'")
pzcqs.text = dt.Compute("count(订单编号)", filter & " and 完工='超期'")
pzzjl.text = format(pzaqs.text / pzs.text, "0.00%")


 回到顶部