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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using DCount with an expression 2

Status
Not open for further replies.

ray436

Technical User
Apr 11, 2000
254
0
0
CA
I am probably doing this the hard way, but what I need is a total on my report that shows the number of occurances of either "found" or "closed" from the "status" field in a query that produces a list of records that have either "found" or "closed" in them for a particular client.

The query does isolate the client, but the total I end up with applies to all records in the table.

this is what I have in the control property:

=DCount("[MASTER DATABASE]![status]","[MASTER DATABASE]","[status]='FOUND'")

I need to qualify the "status" field to be only the records that match the "client" field that the query is using.

I tried this, but no good:

=DCount("[MASTER DATABASE]![status]","[MASTER DATABASE]","[status]='FOUND'& [client]='whoever'")

Is there a better way?

Thanks!!

Ray
 
Try these:

=DCount("status","MASTER DATABASE","status = 'FOUND' AND client = 'whoever'")

OR

=DCount("status","MASTER DATABASE","status = 'FOUND' AND client = ' & me.clientbox & "'")



Mike Rohde
rohdem@marshallengines.com
 
Now were talkin'

thanks Mike, it was a day when the longer you look the more confused you get!

Like what you have, and it works too! What I found also works was to name the Query "getFound", (the query that the report is based on), in the expression like so:

=DCount("status","getFound","status='FOUND'")

I didn't realize that the name of the query could be used in the argument. Now I can just change the query and it ripples through to the report.

Thanks again!

Ray
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top