以文本方式查看主题
- Foxtable(狐表) (http://foxtable.net/bbs/index.asp)
-- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2)
---- 订单交期统计问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=103533)
|
-- 作者:实话实说
-- 发布时间:2017/7/11 9:09:00
-- 订单交期统计问题
请帮我窗口1的代码。我暂末升级新版本,望贴出代码。
|
-- 作者:有点甜
-- 发布时间: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%")
|
-- 作者:实话实说
-- 发布时间:2017/7/11 10:00:00
--
谢谢。另外,订单数要求是【完工】不为空的订单数。
|
-- 作者:有点甜
-- 发布时间:2017/7/11 10:02:00
--
dds.text = dt.Compute("count(订单编号)", filter & " and 完工 is not null")
[此贴子已经被作者于2017/7/11 10:19:27编辑过]
|
-- 作者:实话实说
-- 发布时间:2017/7/11 10:16:00
--
此主题相关图片如下:snap1.jpg
|
-- 作者:有点甜
-- 发布时间:2017/7/11 10:19:00
--
dds.text = dt.Compute("count(订单编号)", filter & " and 完工 is not null")
|
-- 作者:实话实说
-- 发布时间:2017/7/11 10:22:00
--
我笨,再谢了.
|
-- 作者:实话实说
-- 发布时间:2017/7/25 11:29:00
--
还有问题,以上统计的是品种准交率,并不是订单的准交率,因为1个订单包含多个品种。实例中的窗口2如何计算订单的准交率。1个订单的2个品种没有完成,只能算1次订单没按期
[此贴子已经被作者于2017/7/25 11:31:25编辑过]
|
-- 作者:有点甜
-- 发布时间: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%")
|
-- 作者:实话实说
-- 发布时间:2017/7/25 13:51:00
--
再次谢谢有点甜
|