以文本方式查看主题 - 易表在线答疑 (http://egrid2000.com/dvbbs/index.asp) -- 用户社区 (http://egrid2000.com/dvbbs/list.asp?boardid=2) ---- 用于完成统计功能的这个公式是否有问题,不能正确出结果!主要是MSGBOX不执行! (http://egrid2000.com/dvbbs/dispbbs.asp?boardid=2&id=3940) |
-- 作者:arshina -- 发布时间:2006/9/17 13:31:00 -- 用于完成统计功能的这个公式是否有问题,不能正确出结果!主要是MSGBOX不执行! 用于完成统计功能的这个公式是否有问题,不能正确出结果!主要是MSGBOX不执行! Setlabel("",if(text([%开始日期%])>"" Or text([%结束日期%])>"" Or [%机型%]>"" and [%区域%]>"" Or [%维修部位%]>"" Or [%维修部位子类%]>"",if([%班次%]>"",countfor("设备维修数据", "日期",">=",[%开始日期%] , "日期","<=",[%结束日期%],"班次","=",[%班次%],"机号","=",[%机号%],"机型","=",[%机型%],"区域","=",[%区域%],"维修部位","=",[%维修部位%],"维修部位子类","=",[%维修部位子类%]),countfor("设备维修数据", "日期",">=",[%开始日期%] , "日期","<=",[%结束日期%],"机号","=",[%机号%],"机型","=",[%机型%],"区域","=",[%区域%],"维修部位","=",[%维修部位%],"维修部位子类","=",[%维修部位子类%])),msgbox("无法完成统计!请填写必要的数据!",0))) |
-- 作者:gdxhq -- 发布时间:2006/9/17 14:01:00 -- if(text([%开始日期%])>"" Or text([%结束日期%])>"" Or [%机型%]>"" and [%区域%]>"" Or [%维修部位%]>"" Or [%维修部位子类%]>"",if([%班次%]>"",setlabel("",countfor("设备维修数据", "日期",">=",[%开始日期%] , "日期","<=",[%结束日期%],"班次","=",[%班次%],"机号","=",[%机号%],"机型","=",[%机型%],"区域","=",[%区域%],"维修部位","=",[%维修部位%],"维修部位子类","=",[%维修部位子类%])),setlabel("",countfor("设备维修数据", "日期",">=",[%开始日期%] , "日期","<=",[%结束日期%],"机号","=",[%机号%],"机型","=",[%机型%],"区域","=",[%区域%],"维修部位","=",[%维修部位%],"维修部位子类","=",[%维修部位子类%]))),msgbox("无法完成统计!请填写必要的数据!",0)) |
-- 作者:lmk -- 发布时间:2006/9/17 14:04:00 -- 从语法上来讲函数msgbox应该放在Setlabel函数的前面另做判断,这种问题最好把文件传上来才能快速得到满意的解答。 |
-- 作者:xj22710 -- 发布时间:2006/9/17 23:05:00 -- msgbox()函数是无法在SetLabel()里正确执行的,前者是弹出窗口提示,后者是设置标签显示内容,所以你应该改一下你的公式,将msgbox去掉,直接显示内容即可。 Setlabel("",if(text([%开始日期%])>"" Or text([%结束日期%])>"" Or [%机型%]>"" and [%区域%]>"" Or [%维修部位%]>"" Or [%维修部位子类%]>"",if([%班次%]>"",countfor("设备维修数据", "日期",">=",[%开始日期%] , "日期","<=",[%结束日期%],"班次","=",[%班次%],"机号","=",[%机号%],"机型","=",[%机型%],"区域","=",[%区域%],"维修部位","=",[%维修部位%],"维修部位子类","=",[%维修部位子类%]),countfor("设备维修数据", "日期",">=",[%开始日期%] , "日期","<=",[%结束日期%],"机号","=",[%机号%],"机型","=",[%机型%],"区域","=",[%区域%],"维修部位","=",[%维修部位%],"维修部位子类","=",[%维修部位子类%])),"无法完成统计!请填写必要的数据!")) |