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

Counting Records !? 1

Status
Not open for further replies.

Lockstock2SB

Technical User
Oct 29, 2001
53
GB
Hi All,

I'm trying to make a report that counts the total amount of records included in it. The report is based on a query that only produces the records i want.

I tried placing =[Count](*) in the control source of a text box, but it doesnt seem to work.

Also - is it possible to produce one report that displays a count of all records with a certain criteria from one table e.g A report that shows i've had 54 records entered as "A" , and 23 records with "B" entered ?


Could anyone help ?

Thanks in advance !! :eek:)
Steve
 
=Count(*)

. . . no brackets.

To get the groups counts, you may want to use sorting and grouping, depending on how many of those categories you have, and then place the =Count(*) in the group header or footer.
 
1) Your count should reference a field on the report, not *.

If you have a field in the details called OrderID, your count in a report footer text box would be:

=Count([OrderID])

2) On your second question, Let's say you have a field called OrderType, which contains "A", "B" or "C". You want to know how many of each of those you have. If you just want a count, create a footer (View | Sorting & Grouping) for the OrderType field. In this footer, put:

="Total count for " & [OrderType] & ": " & Count([OrderType])

Jim Lunde
compugeeks@hotmail.com
We all agree your theory is crazy, but is it crazy enough?
 
You need to be careful here . .

If you use =Count(*), you insure you are counting all records returned in the query for that group.

If you use =Count([YourField]), this will count the number of rows in which YourField is not null. If you choose to reference a field in your count statement and any of those records' fields are null, Count will not return an accurate row count. - - - -

Bry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top