Count by group - Need Help

LeoDee

Registered User.
Local time
Today, 03:35
Joined
Dec 4, 2002
Messages
31
I have a report showing classes offered, dates classes held and students attending each class, ie.,

Class: Computer Basics
10 May - 25 May
Joe Jones
Mary Smith
Etc
25 July - 15 Aug
Paul Albert
Marty Cruz
etc
Class: Word Processing
02 Jan - 26 Jan
Phil Evans
etc, etc.

I am able to count the students, but have not figured out how to count 1) the number of classes offered and 2) the number of classes held.

Can anyone help me with this?

Running XP and Access 2000
 
In your Report, in the Report footer or a group footer, add two text boxes. Set the control source for each text box to
=Count([YourFieldName]).
This should do the job for you.

Regards,
Patrick.
 
Record Count Not Working

Patrick:

I tried what you suggested but all it does is bring back a count of ALL the records.

For simplicity's sake each record contains "Class Name", "Start Date", & "Student's Name".

I want a count of number of times "Class Name" breaks and the number of times "Start Date" breaks within "Class Name".

Totals to show in the "Class Name" footer and the overall footer.

Thanks,

Rick
 
Hi Rick,
If you put the text boxes in a group footer, they should count the records for the group.
If the text boxes are placed in the Report footer they should display the totals.

Is this what you're doing? I'll verify on my own machine & post back any updates.

Regards,
Patrick
 
Hi Rick - just tested on my machine & all was fine - are you still having problems?
 
Patrick:

In the CLASS NAME group footer I put =count([Class Name]) it should always give me a count of 1 since there will be one CLASS NAME per group, but, it brings back a count of the total number of records. The same is true when I count START TIMES in each CLASS NAME group. The count I get back is the total records not the number of different START TIMES occurences.

In further searching I found an article at another website that explains how to count by groups. If that works, I will post the reference to it.

Thanks,

Rick
 
Arghhhhhhhhh!!!

That is website I had been looking at. Made a lot of sense until I tried it.

I set up the control in the header and named it "Counter" and set its control to = 1. Then I set its Running Sum property to Over All. I kept it visible so I could see what was going on. So far, so good.

Next, in the footer I set up another control named "Class Count" and set its control as =[Counter]. The only thing I get on my report was #NAME? I have been messing with different variations but always get the same thing.

I know this must be something simple, but it has me baffled!

Any help will be appreciated.

Rick
 
It Is Working!!

Not sure if its the best way or the right way but I can now count the number of groups in a report. Here is how I did it.

I added a control to the header of the group I want to count. Its control source is set to =1. The running sum is set to either OVER ALL or BY GROUP depending where I want the totals to appear. If OVER ALL then totals appear in the report footer. If BY GROUP then totals will appear in the respective group footer.

I had read that if next I placed a control in the footer where I wanted the totals to appear and set it up as =[header control name]. However this gave me a #Name? error.

So, I set up a control in the footer without a control source. Then I got the footer's properties and on PRINT I coded it so the footer control would equal the header control and voila...it works.

For example....

The header control is COUNTER (control source =1)
The footer control is TOTALCLASSES
The coding is TOTALCLASSES=COUNTER

Thanks for everyone's help.
 
I have been having the same problem.
I was able to get the correct counts by placing a calculated control in the group footer.
I set the Countrol Source property to =Count([fieldtocount]) and I set the Running sum property to No
I am now getting the correct counts.

I hope this works for you.

Jane
 
Jane:

Thanks for your input. However, what you suggest only counts the number of records. What I am trying to do, in addition to counting the number of records, is count how many groups of records there are in the report. What I wanted to count is the number of courses offered, the number of classes scheduled by course and the number of students who took the course.

Rick
 
Hello,

I decided to dig up a really old post!

Question, this is the code given here:

=Count([YourFieldName])

(This is all just a very generic example off top my head that would be helpful for several applications in my db)

Now, say I had a field that has a lookup table with three possibilities, now say I made a report to show order history for the past month (or whatever). Say those three possiblities in said field were:

1 - Active
2 - In Progress
3 - Closed

These would be grouped by employee ID as in the original post here, say in the group's footer I wanted something like this:

Total Orders:
Active Orders:
Orders In Progress:
Closed Orders:

How would this be done? For this example, say the field mentioned above was [OrderStatus]. If any other info is needed, let me know, but like I said,m this is just a quick generic example.

Thank you!!!
 

Users who are viewing this thread

Back
Top Bottom