DCOUNT with 2 Criteria

  • Thread starter Thread starter Mary Z
  • Start date Start date
M

Mary Z

I have a formula in a Report Footer that I would like to calculate on 2
criteria. So far I have the following which counts all Bundle RES ADSL 1M
Rate Plans. I would like to have these counted only if the Dial Up
Number=225. I have tried putting AND at the end but it is counting more than
the total available.l

=DCount("[Rate Plan2]","WTCiweb Table","[Rate Plan2]='Bundle RES ADSL 1M'")

All help is appreciated. Thank you.
Mary
 
I have a formula in a Report Footer that I would like to calculate on 2
criteria. So far I have the following which counts all Bundle RES ADSL 1M
Rate Plans. I would like to have these counted only if the Dial Up
Number=225. I have tried putting AND at the end but it is counting more than
the total available.l

=DCount("[Rate Plan2]","WTCiweb Table","[Rate Plan2]='Bundle RES ADSL 1M'")

All help is appreciated. Thank you.
Mary

=DCount("*","WTCiweb Table","[Rate Plan2]='Bundle RES ADSL 1M' and
[Dial Up Number] = 225")

The above assumes [Dial Up Number] is a Number datatype.
 
I do not know much about DCount but try this --
=DCount("[Rate Plan2]","WTCiweb Table","[Rate Plan2]='Bundle RES ADSL 1M' &
[Dial Up Number]=225")
 
I have a formula in a Report Footer that I would like to calculate on 2
criteria. So far I have the following which counts all Bundle RES ADSL 1M
Rate Plans. I would like to have these counted only if the Dial Up
Number=225. I have tried putting AND at the end but it is counting more than
the total available.l

=DCount("[Rate Plan2]","WTCiweb Table","[Rate Plan2]='Bundle RES ADSL 1M'")

All help is appreciated. Thank you.
Mary

The third argument to DCount (or any of the domain functions) is a string
which evaluates to a valid SQL WHERE clause without the word WHERE. Assuming
that the [Dial Up Number] field is in fact a number datatype (otherwise you
need more quotemarks) try

=DCount("[Rate Plan2]","WTCiweb Table","[Rate Plan2]='Bundle RES ADSL 1M' AND
[Dial Up Number] = 225")
 
Back
Top