Counting in a Report

C

Chris Guimbellot

Hello,

Access2K. I have a report where in one column, for each record, it has one
of three values. What I would like to do is at the end of the report create
a summary that has three text boxes representing the number of times that
value occurred in that column. If possible, I would also like to have three
more text boxes representing the percentage of the total for each value. Any
ideas as to how to do this? Thanks,

Chris
 
F

fredg

Hello,

Access2K. I have a report where in one column, for each record, it has one
of three values. What I would like to do is at the end of the report create
a summary that has three text boxes representing the number of times that
value occurred in that column. If possible, I would also like to have three
more text boxes representing the percentage of the total for each value. Any
ideas as to how to do this? Thanks,

Chris

In the Report Footer, add 7 unbound controls:
As control sources:
=Sum(IIf([YourField] = value1,1,0))
name this one "Sum1"

=Sum(IIf([YourField] = value2,1,0))
Name this "Sum2"

=Sum(IIf([YourField] = value3,1,0))
Name this "Sum3"

= Sum([YourField])
Name this TotalSum

=[Sum1]/[TotalSum]*100
=[Sum2]/[TotalSum]*100
=[Sum3]/[TotalSum]*100

Set the above 3 control's Format property to Percent
 
C

Chris Guimbellot

Fred,

That worked like a champ. Thanks a lot. I appreciate it.

Chris

fredg said:
Hello,

Access2K. I have a report where in one column, for each record, it has one
of three values. What I would like to do is at the end of the report create
a summary that has three text boxes representing the number of times that
value occurred in that column. If possible, I would also like to have three
more text boxes representing the percentage of the total for each value. Any
ideas as to how to do this? Thanks,

Chris

In the Report Footer, add 7 unbound controls:
As control sources:
=Sum(IIf([YourField] = value1,1,0))
name this one "Sum1"

=Sum(IIf([YourField] = value2,1,0))
Name this "Sum2"

=Sum(IIf([YourField] = value3,1,0))
Name this "Sum3"

= Sum([YourField])
Name this TotalSum

=[Sum1]/[TotalSum]*100
=[Sum2]/[TotalSum]*100
=[Sum3]/[TotalSum]*100

Set the above 3 control's Format property to Percent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top