DCount function

jzacharias

Registered User.
Local time
Today, 12:49
Joined
Sep 13, 2010
Messages
137
I am having trouble using the DCount function to return the number of records from two different fields. I am able to return records from one field. Not sure of the correct syntax for multiple fields.
 
I am having trouble using the DCount function to return the number of records from two different fields. I am able to return records from one field. Not sure of the correct syntax for multiple fields.
You would need TWO Dcounts (one for each table) and then add them together.
 
What if it's from a query?
 
DCount is a Domain Function and can take Table/Query..
 
Query is called Total Citations
I want to count total records if Field "Shift" = Days and field "Rotation" = Green
 
Try..
Code:
DCount("*","[Total Citations]","Shift='Days' AND Rotation='Green'")
 
I had it like that except for the "*". What does that do?
 
Normally when using a DCount you would not have a specific column to count from.. in other words it does not matter which field it uses to count.. you can specify columns, absolutely nothing wrong in that.. for simplicity we use *..

& - is a concatenating variable.. unlike Java or other programming language & does not mean the Logical AND in VBA..
 

Users who are viewing this thread

Back
Top Bottom