DSum有多个标准 [英] DSum with multiple criteria

查看:65
本文介绍了DSum有多个标准的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用简单的DSum功能添加组织中每个成员的捐款。它看起来像这样:


dTotal = DSum(SplitAmt,[GiftSplits],[Gift ID] = &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


SplitAmt是包含捐赠金额的字段。 GiftSplits是表的名称。礼品ID是包含给予每个捐赠者的ID号的字段。


在GiftSplits表中是另一个名为Restrictions的字段。该字段中的一些记录包含值OutsideIN。这意味着礼物受到限制,以至于钱必须在印第安纳州以外的地方使用。我想对此进行调整,以便添加所有礼物,以期在印第安纳州以外限制使用。


例如:

Joe捐赠者捐赠100美元; $ 500;限制在印第安纳州使用的250美元和在印第安纳州外使用的1,000美元的捐赠。我想让dTotal排队850美元。


我知道这可能很简单,但这是我第一次接触VB,我已经尝试了所有我能想到的东西。在此先感谢您的帮助。

I am using a simple DSum function to add donations made by each member of an organization. It looks like this:

dTotal = DSum("SplitAmt", "[GiftSplits]", "[Gift ID] = " & Format(lGiftID))

SplitAmt is the field that contains the amount of the donation. GiftSplits is the name of the table. Gift ID is the field that contains the ID number given to each donor.

In the GiftSplits table is another field called Restrictions. Some records in this field contain a value of "OutsideIN" meaning that the gift was restricted so that the money has to be used outside the state of Indiana. I want to adapt this so that it adds all gifts expect those that were restricted for use outside Indiana.

For example:
Joe donor made donations of $100; $500; and $250 that are restricted for use in Indiana and one donation of $1,000 for use outside Indiana. I want dTotal to queal $850.

I know this should probably be simple, but this is my first exposure to VB and I''ve tried everything I can think of. Thanks in advance for your help.

推荐答案

100;


500;和


250限制在印第安纳州使用和一次捐赠
250 that are restricted for use in Indiana and one donation of


这篇关于DSum有多个标准的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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