获取 Microsoft Access 报告中两个计数之间的差异

发布于 2024-11-02 20:27:39 字数 77 浏览 0 评论 0原文

我有一份报告,其中列出了两个字段,即约会和缺勤。现在我想要的是在构建报告后,我想得到这两个计数之间的差异。这可能吗?

谢谢!

I have a report which lists 2 fields namely appointments and absences. Now what I want is that after building the report, I want to get the difference between these 2 counts. Is that possible?

thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一个人的夜不怕黑 2024-11-09 20:27:39

如果您的报表上有两个字段:约会和缺勤,并且它们的名称相同,请创建一个未绑定的控件并将其 ControlSource 指定为:

  =[Appointments]-[Absences]

现在,我真的不建议使用它,因为控件和它们必然具有相同名称的字段。我将绑定到 Appointments 的控件重命名为 txtAppointments,将绑定到 Absences 的控件重命名为 txtAbsences,然后计算将是 [txtAppointments]-[ txt缺席]

现在,请记住,这假设这两个字段都不为空。如果是,您可能想要这个:

  =Nz([txtAppointments], 0)-Nz([txtAbsences], 0)

尝试看看它是否有效!

If your report has two fields on it, Appointments and Absences, and they are named the same, create an unbound control and assign its ControlSource to be this:

  =[Appointments]-[Absences]

Now, I wouldn't really recommend using that, since it's likely that the controls and the fields they are bound to have the same name. I'd rename the control that is bound to Appointments as txtAppointments and the one bound to Absences as txtAbsences, and the calculation would then be [txtAppointments]-[txtAbsences].

Now, keep in mind that this assumes that neither field is ever Null. If it is, you probably want this, instead:

  =Nz([txtAppointments], 0)-Nz([txtAbsences], 0)

Try and see if it works!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文