DCOUNT with 2 Criteria

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
 
F

fredg

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.
 
K

KARL DEWEY

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")
 
J

John W. Vinson

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")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top