DCOUNT HELP!

G

Guest

I am trying to dcount the total records in a group (report) the footer of
each grouped employee and a specified rating. The problem I am having is my
dcount is dcounting all employees and the specified rating in the report
below is my code. I appreciate the help.

=DCount("[PerformCode] = 'BE'","erptEEsPerformEvaluate","[EEID] =
Reports![Employees Performance Evaluation]![txtEEID]")
 
M

Marshall Barton

Tru said:
I am trying to dcount the total records in a group (report) the footer of
each grouped employee and a specified rating. The problem I am having is my
dcount is dcounting all employees and the specified rating in the report
below is my code. I appreciate the help.

=DCount("[PerformCode] = 'BE'","erptEEsPerformEvaluate","[EEID] =
Reports![Employees Performance Evaluation]![txtEEID]")


You can calculate the number of detail records in any group
level by using the expression =Count(*)
If you're trying to count only the ones that match a
specific value, then you woulf do it this way:
=Sum(IIf(PerformCode = 'BE', 1, 0))

If you really need to use a Domain Aggregate function, try
this:
= -DSum("[PerformCode] = 'BE'",
"erptEEsPerformEvaluate", "[EEID] = " & Reports![Employees
Performance Evaluation]!txtEEID)
 
F

fredg

I am trying to dcount the total records in a group (report) the footer of
each grouped employee and a specified rating. The problem I am having is my
dcount is dcounting all employees and the specified rating in the report
below is my code. I appreciate the help.

=DCount("[PerformCode] = 'BE'","erptEEsPerformEvaluate","[EEID] =
Reports![Employees Performance Evaluation]![txtEEID]")

DCount counts all records in your table, not just the ones in the
report.
In the Group Footer =Count(*) will count all the records in that group
in the report.
If you wish to count only those in the group that meet certain
criteria, then, in the Group footer:
=Sum(IIf([SomeField] = Criteria,1,0))
 
G

Guest

THANX!!! Marshall and Fredg
--
Thanx!


Marshall Barton said:
Tru said:
I am trying to dcount the total records in a group (report) the footer of
each grouped employee and a specified rating. The problem I am having is my
dcount is dcounting all employees and the specified rating in the report
below is my code. I appreciate the help.

=DCount("[PerformCode] = 'BE'","erptEEsPerformEvaluate","[EEID] =
Reports![Employees Performance Evaluation]![txtEEID]")


You can calculate the number of detail records in any group
level by using the expression =Count(*)
If you're trying to count only the ones that match a
specific value, then you woulf do it this way:
=Sum(IIf(PerformCode = 'BE', 1, 0))

If you really need to use a Domain Aggregate function, try
this:
= -DSum("[PerformCode] = 'BE'",
"erptEEsPerformEvaluate", "[EEID] = " & Reports![Employees
Performance Evaluation]!txtEEID)
 

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 the values 0
Get Sums for 2 DCount fields on report 1
Access MS Access DCount function problem 0
DCount 9
dcount 2
Count or DCount used in a report 1
Sum DCOUNT Calculated Control 2

Top