当一个或多个为空时,计算子报表中的值 [英] Calculating values from subreports when one or more is null

查看:81
本文介绍了当一个或多个为空时,计算子报表中的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找到了类似的东西,但是不能让它起作用 - 也许是因为我在报告而不是查询中工作?


我有一个主要的报告中有三个子报告。每个子报表都有该子报表中项目的总计。如果所有三个都有条目,我可以得到一个总数,但如果一个或多个没有,它只是说错误。我首先尝试使用IIf / IsNull,但同样,只有当所有三个子报表都有金额时才能获得总计。然后我找到了nz,并尝试了这一点,但是当所有三个都有值时,我仍然得到一个总数。这似乎不应该那么复杂。


这就是我所拥有的:

I found something similar, but can''t get it to work--maybe because I''m working in a report rather than a query?

I have a main report that has three subreports in it. Each subreport has a total for items in that subreport. If all three have entries, I can get a grand total, but if one or more doesn''t, it just says error. I first tried using IIf/IsNull, but again, I get totals only when all three subreports have amounts. I then found nz, and tried that, but still I only get a total when all three have values. This seems like it just shouldn''t be that complicated.

Here''s what I have:

< span class =codeLinkonclick =Blur(this,this.parentNode.parentNode,getChildren(this),true);>展开 | 选择 | Wrap | 行号

推荐答案

如果Null,你必须给Nz一个值来返回。 Nz(FieldName,0)
You have to give Nz a value to return if Null. Nz(FieldName, 0)



我发现类似的东西,但是不能让它起作用 - 也许是因为我''我在报告而不是查询中工作?


我有一个主报告,里面有三个子报告。每个子报表都有该子报表中项目的总计。如果所有三个都有条目,我可以得到一个总数,但如果一个或多个没有,它只是说错误。我首先尝试使用IIf / IsNull,但同样,只有当所有三个子报表都有金额时才能获得总计。然后我找到了nz,并尝试了这一点,但是当所有三个都有值时,我仍然得到一个总数。这似乎不应该那么复杂。


这就是我所拥有的:

I found something similar, but can''t get it to work--maybe because I''m working in a report rather than a query?

I have a main report that has three subreports in it. Each subreport has a total for items in that subreport. If all three have entries, I can get a grand total, but if one or more doesn''t, it just says error. I first tried using IIf/IsNull, but again, I get totals only when all three subreports have amounts. I then found nz, and tried that, but still I only get a total when all three have values. This seems like it just shouldn''t be that complicated.

Here''s what I have:

< span class =codeLinkonclick =Blur(this,this.parentNode.parentNode,getChildren(this),true);>展开 | 选择 | Wrap | 行号


感谢您的建议,但我仍然没有得到任何工作。我仍然必须遗漏一些东西,或者我不明白我应该做些什么。


我尝试了三种不同的东西 -

这个,其中包括零值:
Thanks for the suggestions, but I''m still not getting anything to work. I must still be missing something, or didn''t understand exactly what I was supposed to do.

I tried three different things--
This, which includes the zero value:
展开 | 选择 | Wrap | 行号


这篇关于当一个或多个为空时,计算子报表中的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆