I am looking for a function that mimics the "COUNTIF" function in excel. I
need Access to tally up the number of times a name appers in a report (or
query in which the report willbe run from). Any help?
If you want to count the number of records in a report where the [Gender]
field is "F", you can use and expression in a group or report header or
footer like:
=Sum(Abs([Gender]="F"))
To count the number of females in the HR department, use:
=Sum(Abs([Gender]="F" And [Dept]="HR"))
To sum the salaries of all females:
=Sum(Abs([Gender]="F") * [Salary])

Signature
Duane Hookom
MS Access MVP
--
>I am looking for a function that mimics the "COUNTIF" function in excel. I
> need Access to tally up the number of times a name appers in a report (or
> query in which the report willbe run from). Any help?
Rick - 29 Jun 2005 21:35 GMT
I am new to Access so where would I put this code? in the report template
somewhere?
> If you want to count the number of records in a report where the [Gender]
> field is "F", you can use and expression in a group or report header or
[quoted text clipped - 8 lines]
> > need Access to tally up the number of times a name appers in a report (or
> > query in which the report willbe run from). Any help?
Duane Hookom - 30 Jun 2005 03:52 GMT
Use the expression as the control source of a text box.

Signature
Duane Hookom
MS Access MVP
>I am new to Access so where would I put this code? in the report template
> somewhere?
[quoted text clipped - 13 lines]
>> > (or
>> > query in which the report willbe run from). Any help?