Count function question

  • Thread starter Thread starter pow67
  • Start date Start date
P

pow67

Without making another query, I would like to count to number of records
in a particular [CITY] such as "Deerfield". Is this possible ?

None of these worked:

=Count([CITY] Like "Deerfield")

=Count([CITY]."Deerfield")

=Count([CITY.Deerfield])

=DCount("[CITY]", "Deerfield")

Thanks in advance.

CW

=Count([CITY] like "allendale")
 
Thanks for you help. As you suggested, I entered:

=DCount("*", "AldCat", "[CITY] Like """Deerfield""")

but when I save the report the control source is truncated to:

=DCount([CITY],"Deerfield")

and "#error" appears on the report.

I also count 11 quote marks in your suggestion but I am not sure which
one to delete (or add another) to make it an even number.

Thanks again in advance.

CW
 
=DCount("*", "AldCat", "[CITY] Like """Deerfield""")
but when I save the report the control source is truncated to:

=DCount([CITY],"Deerfield")

and "#error" appears on the report.

I also count 11 quote marks in your suggestion but I am not sure which
one to delete (or add another) to make it an even number.

Good catch. Try:

=DCount("*", "AldCat", "[CITY] Like ""Deerfield""")

The embedded double double quotes represent single double quotes (") when the
expression is evaluated - string comparisons need to have the string values
surrounded by quotes.

As for why the control's "control source" property is changing when you save the
report, it may have been related to the syntax error that you discovered.

:-)
 
That did it. It works.

Thanks again.

I am still not clear on what the "*" does after =DCount(....). Could you
elaborate or direct me to a resource?

CW
 
Back
Top