DCOUNT segregation

D

DubboPete

Hi all

Am trying to count the number of records in a table depending on their
"setting". Table is Clinics, containing ClinicID and Setting fields.

I need to know how many fields match "Pharmacy", "Clinic", "Hospital"
and "Private Hospital"

I have searched the group, and tried applying all the different
scenarios for that function, but I can't get DCOUNT to count anything
but the total number! Every syntax I try fails with either "#name" or
Error!

Any help is appreciated

Pete
 
T

Tom van Stiphout

On Wed, 18 Mar 2009 21:29:42 -0700 (PDT), DubboPete

In the Immediate window enter:
?DCount("ClinicID", "Clinics", "setting='Pharmacy'")
(note the single-quotes wrapping the string value Pharmacy)

-Tom.
Microsoft Access MVP
 
D

DubboPete

On Wed, 18 Mar 2009 21:29:42 -0700 (PDT), DubboPete


In the Immediate window enter:
?DCount("ClinicID", "Clinics", "setting='Pharmacy'")
(note the single-quotes wrapping the string value Pharmacy)

-Tom.
Microsoft Access MVP









- Show quoted text -

Thanks Tom, the single quotes note was the trick!
works fine now...

Pete
 

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

Similar Threads

Access Dcount (multiple criteria) 3
DCount alwaysreturning 1 0
DCount in Subform question 1
DCount Porblem 4
Multi field link in table relationship 2
dcount 1
Dcount returning no results!!! 0
Dcount Problem 2

Top