以文本方式查看主题

-  易表在线答疑  (http://egrid2000.com/dvbbs/index.asp)
--  用户社区  (http://egrid2000.com/dvbbs/list.asp?boardid=2)
----  [求助]请版主帮忙  (http://egrid2000.com/dvbbs/dispbbs.asp?boardid=2&id=3361)

--  作者:惊堂木
--  发布时间:2006/8/22 11:53:00
--  [求助]请版主帮忙



-=-=-=- 以下内容由 惊堂木2006年08月22日 11:54am 时添加 -=-=-=-
哪位大侠知道这个问题怎么解决?我的易表是1708
--  作者:smileboy
--  发布时间:2006/8/22 12:02:00
--  
是否存在函数嵌套问题
--  作者:惊堂木
--  发布时间:2006/8/22 12:17:00
--  
公式比较长。请问是嵌套错误造成的吗?
--  作者:czy
--  发布时间:2006/8/22 12:19:00
--  
看你出错的图片应该是函数嵌套引起的,你可以将公式贴上来看看。
--  作者:惊堂木
--  发布时间:2006/8/22 12:27:00
--  
if([%主合同名称%] = "" , msgbox("主合同名称不能为空", 0),RecalcGrid(GridName) and showallrows() and if(LocateFor("合同名称"," = ",[%主合同名称%]) > 0,SetVariable("%个总%",CountFor("合同表","主合同名称"," = ",[%主合同名称%],"附属合同","= ",- 1)) and SetVariable("%金总%",SumFor("合同表","合同总金额","主合同名称"," = ",[%主合同名称%],"附属合同","= ",- 1))and SetVariable("%项目金额%",SumFor("合同表","合同总金额","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","收入")) and SetVariable("%个材%",CountFor("合同表","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","材料采购")) and SetVariable("%金材%",SumFor("合同表","合同总金额","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","材料采购")) and SetVariable("%个安%",CountFor("合同表","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","安装合同")) and SetVariable("%金安%",SumFor("合同表","合同总金额","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","安装合同"))  and SetVariable("%个分%",CountFor("合同表","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","分包")) and SetVariable("%金分%",SumFor("合同表","合同总金额","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","分包"))  and SetVariable("%个管%",CountFor("合同表","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","项目管理")) and SetVariable("%金管%",SumFor("合同表","合同总金额","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","项目管理"))  and SetVariable("%个其%",CountFor("合同表","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","其它")) and SetVariable("%金其%",SumFor("合同表","合同总金额","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","其它"))and SetVariable("%个挂%",CountFor("合同表","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","挂靠成本")) and SetVariable("%金挂%",SumFor("合同表","合同总金额","主合同名称"," = ",[%主合同名称%],"合同分类_三级"," = ","挂靠成本")),MsgBox("没有找到符合条件的行!",0)))
--  作者:czy
--  发布时间:2006/8/22 12:31:00
--  
SetVariable("%个总%",CountFor("合同表","主合同名称"," = ",[%主合同名称%],"附属合同","= ",- 1) )

将红色部分改成表达式变量即可。
具体可参看帮助一个麻烦的问题。


--  作者:惊堂木
--  发布时间:2006/8/22 12:44:00
--  
谢谢CZY版主!!“表达式变量”?我还是不太明白,能否讲得详细点?我的易表知识很久没更新了。:)
--  作者:czy
--  发布时间:2006/8/22 12:53:00
--  
就是增加一个表达式变量,比如是%A%,然后把上述公式的红色部分贴到变量的表达式/候选值中,最后把上述公式改成:SetVariable("%个总%",[%A%])就可以了。

5楼公式中所有SetVariable中赋值部份均要改。