当第三个字段中的条件为假时,如何在2个字段中保持零值 [英] How can i have zero values in 2 fields when the criteria in a third field is false

查看:99
本文介绍了当第三个字段中的条件为假时,如何在2个字段中保持零值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我有一个名为TRANSACTIONS的表,此表包含3个字段: TRANSACTION DATE,DRAMOUNT和CRAMOUNT


我创建一个查询的查询对于开始交易日期,然后显示以前交易日期的 DRAMOUNT CRAMOUNT 的总计。


如果我有在开始日期之前的交易一切都还可以,但是如果我不是,我的查询没有结果,而我想得到零值。


有人可以帮助

解决方案

您可以在查询中简单地使用If公式。像这样:

展开 | 选择 | Wrap | 行号


我已经使用了类似的Nz函数,如下所示

展开 | 选择 | Wrap | 行号


Sum()函数已处理null值,但我相信如果没有处理记录,仍会返回Null。因此, Nz()调用应该在 Sum()调用之外:

展开 | 选择 | Wrap | 行号

Hello, am having a table called TRANSACTIONS, this table contains 3 fields : TRANSACTION DATE, DRAMOUNT and CRAMOUNT.

I create a Query that ask for a starting transaction date and then shows the totals for the DRAMOUNT and CRAMOUNT for the previous transactions dates.

If i have transactions before the starting date everything is ok but if i don''t, i get no results in my query while i want to get zero values.

can someone please help

解决方案

You can simple use ''If'' formula in the query. something like this :

Expand|Select|Wrap|Line Numbers


I am already use the similar Nz function as you can see below

Expand|Select|Wrap|Line Numbers


The Sum() function already handles null values, but I believe still returns Null if there are no records processed. Thus, the Nz() call should be outside of the Sum() call as :

Expand|Select|Wrap|Line Numbers


这篇关于当第三个字段中的条件为假时,如何在2个字段中保持零值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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