Any way to tally in reports?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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])
 
I am new to Access so where would I put this code? in the report template
somewhere?

Duane Hookom said:
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])

--
Duane Hookom
MS Access MVP
--

Rick said:
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?
 
Use the expression as the control source of a text box.

--
Duane Hookom
MS Access MVP


Rick said:
I am new to Access so where would I put this code? in the report template
somewhere?

Duane Hookom said:
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])

--
Duane Hookom
MS Access MVP
--

Rick said:
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?
 
Back
Top