以下是用来在窗口显示统计数量的代码,感觉大部分统计的执行在重复 ,实际显示也很慢。
求助1 :本人小白,那位大神帮忙简化一下,也可以甩个help链接
求助2 :有没有好的,统计方式,甩个help帮助链接也行
此主题相关图片如下:ade20200929.jpg
Dim zzx As Integer
Dim sja As Integer
Dim sca As Integer
Dim faa As Integer
Dim sjw As Integer
Dim sjz As Integer
Dim scw As Integer
Dim scz As Integer
zzx = DataTables("maintable01").SQLCompute("Count(*)","项目编号 <> ' ' and 交货= '生产中'")
sja = DataTables("maintable01").SQLCompute("Count(*)","项目编号 <> ' ' and 交货= '生产中' and 项目类型='设计案'")
sca = DataTables("maintable01").SQLCompute("Count(*)","项目编号 <> ' ' and 交货= '生产中' and 项目类型='生产案'")
faa = DataTables("maintable01").SQLCompute("Count(*)","项目编号 <> ' ' and 交货= '生产中' and 项目类型='方案'")
sjw = DataTables("maintable01").SQLCompute("Count(*)","项目编号 <> ' ' and 交货= '生产中' and 设计状态='设计待分配'")
sjz = DataTables("maintable01").SQLCompute("Count(*)","项目编号 <> ' ' and 交货= '生产中' and 设计状态='设计中'")
scw = DataTables("maintable01").SQLCompute("Count(*)","项目编号 <> ' ' and 交货= '生产中' and 生产状态='生产未受理'")
scz = DataTables("maintable01").SQLCompute("Count(*)","项目编号 <> ' ' and 交货= '生产中' and 生产状态='生产中'")
Forms("主页").Controls("zzx").text = zzx
Forms("主页").Controls("sja").text = sja
Forms("主页").Controls("faa").text = faa
Forms("主页").Controls("sca").text = sca
Forms("主页").Controls("sjw").text = sjw
Forms("主页").Controls("sjz").text = sjz
Forms("主页").Controls("scw").text = scw
Forms("主页").Controls("scz").text = scz
[此贴子已经被作者于2020/9/29 14:21:07编辑过]