View Full Version : DSum with 2 “<>” criteria


Lmens
09-01-2010, 12:40 PM
Please, can some one please tell me what’s wrong with my DSum function?

=DSum("[AprilVCOS]","VCOSmaster","[D_Level]<>'H.SCOTT'AND 'SurtiVacCalaDB'”) -- this excludes “H.Scott” but includes “SurtiVacCalaDB”

=DSum("[AprilVCOS]","VCOSmaster","[D_Level]<>'H.SCOTT'AND <> 'SurtiVacCalaDB'") –This retures “#Error”

What I want is the sum of all but 'H.SCOTT' and ‘SurtiVacCalaDB’

Always with much appreciation!

lagbolt
09-01-2010, 01:06 PM
=DSum("[AprilVCOS]","VCOSmaster","[D_Level] <> 'H.SCOTT' AND [D_Level] <> 'SurtiVacCalaDB'")

Lmens
09-01-2010, 01:14 PM
Thank you!!

lagbolt
09-01-2010, 01:34 PM
You betcha.
Cheers,

boblarson
09-01-2010, 02:53 PM
An alternative method which works well with more values but can work with even one is:

=DSum("[AprilVCOS]","VCOSmaster","[D_Level] Not In('H.SCOTT','SurtiVacCalaDB')")

Which makes it shorter since you don't have to repeat the field name for each value.

lagbolt
09-01-2010, 03:53 PM
Yeah, that's even tidier. Thanks Bob.