Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dcount

Status
Not open for further replies.

oggstar

Technical User
Sep 8, 2001
18
0
0
AU
I am not having any luck with the following expression,
I had a look at the help function it provides the following information and examples.

«Expr» DCount («expr», «domain», «criteria»)
DCount("[ShippedDate]", "Orders", _ "[ShipCountry] = 'UK' AND [ShippedDate] > #1-1-95#")

I want to count the number of times the feild [DA status] = “On hold”. Looking at the example I I am not quite sure what to put in «expr»

«domain», in my example = table name "Sheet 1
«criteria» = "[DA Status] = 'On Hold' "

I tried the following expressions and they all returned a value of 18 as opposed to the correct answer which is 2.

=DCount("[DA Status]", "Sheet 1", _ "[DA Status] = 'On Hold' ")
=DCount("[DA Status]","Sheet 1","[DA Status] = 'On Hold'")
=DCount("[DA Status]","Sheet 1", "[DA Status] = 'On Hold'")
=DCount("[DA Status] = 'On Hold'")

Any ideas where I am going wrong
 
The syntax of your second and third examples look correct. If the count is incorrect, should your domain be a query that might be limiting the criteria of your count instead of a table?? If so, change the domain to your query....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top