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!

Count function in a report

Status
Not open for further replies.

dgirl1010

Technical User
Jul 14, 2006
20
0
0
US
Hi there, I'm having issues using the Count function in a report. I have two totals in the report footer, one for the total number of records, and one for the total number of a certain type of record (special requests) and also a percentage of the total number of records based on the two counts.

The regular =Count(*) works just fine, but when I try to count just the "special request" records it continues to give me the total number of records, no matter what critera I use.

Details:

The field I'm trying to count is a yes/no format. In one section of the report I have a text box that displays "Special Request" when the yes/no is "Yes" - IIf ([SpecialRequest]=-1,"Special Request",Null). This works fine.

Then in the report footer I have a text box with =Count([SpecialRequests]=-1) - this gives me the total number of requests instead of just the "special requests". I've tried not specifiying the -1, and have also tried 0 to see if I can get a different result. No go.

The really werid thing is that this worked last week. I'm at a loss here.
 
And what about this ?
=Abs(Sum([SpecialRequests]))

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
DCount() is a waste of resources and may give erroneous results. If you open your report with a where condition, the DCount() will not account for the where condition. 99% of reports would expect to count only those values that would appear in the filtered report.

PH has the more efficient method that limit the count to the records returned in the report.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top