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

Count total

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Here is my report output:


[tt] proj_id hours
1 30
5 40
7 30

Total 100[/tt]

How would I get the count (in this example it would be 3) for projects??
For the hours I used the sum function for the hours total.

Please give details for the count part.




 
My first thoughts are that you have achieved the total number of hours in the report footer part, because you have a field whose Control Source is "=Sum(hours)"

In the Report Footer section, you could place another field, and for its control source put a call to the Count() funtion like this:

"=Count(proj_id)"

This should return "3" since there are only three records


Hope I'm on the right track!

birklea birklea ~©¿©~ <><
I know what I know...don't presume that I know what I don't! Smithism!!!
 
Thanks.

Now here is where I am having the problem:

proj_id mod_id hours
3
12 20
13 10
##need total hours here for proj_id 3

4
14 10
15 15
##need total hours here for proj_id 4


I cant get my totals for each group when I do the sum or count it totals it for
all the proj_id's and not by each proj_id such as:

proj_id mod_id hours
3
12 20
13 10
Total hours 55

4
14 10
15 15
Total hours 55



HERE IS WHAT I REALLY NEED:
proj_id mod_id hours
3
12 20
13 10
Total hours 30

4
14 10
15 15
Total hours 25




 
You must have a group header for the PROJ_ID.

In it you can place your PROJ_ID field. Then in the group footer, you can put your Count() & Sum() fields.

This will give you your distinct totals.

Hover your mouse over the details seciotn. right click and select &quot;Sorting & Grouping&quot;. In the next dialog box, select your PROJ_ID from the &quot;Field/Expression combo. In the lower part of the dialog box, under Group Properties, Select &quot;YES&quot; for Group Header & Group Footer. The Group Headers & Footers appear.

Put your field &quot;PROJ_ID&quot; in the header section. Put your Count(PROJ_ID) & SUM(PROJ_ID) fields in the group footer section. Scrunge it up to make it tidy.

See how you get on!

regards

birklea


birklea ~©¿©~ <><
I know what I know...don't presume that I know what I don't! Smithism!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top