count of records that meet criteria from two fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What I need to do is create a query that first finds all records that meet
certain criteria from two different fields then count those records.
We have multiple facilities and programs, so I need to know how many people
are in a certain facility [field1] and a certain program [field2] then count
those.
 
either


DCOUNT( "*", "tableName", "field1='cafeteria' AND field2='eating' ")


either


DCOUNT("*", "tableName", "field1='cafeteria' OR field2='eating' ")


the first one giving the number of records where both conditions occur, the
second expression, where at least one of them occur.


You can use the syntax FORMS!formName!ControlName to refer to a value in a
control:

DCOUNT( "*", "tableName", "field1=FORMS!myForm!whichFacility AND
field2=FORMS!myForm!whichProgram ")




Hoping it may help,
Vanderghast, Access MVP
 

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

Back
Top