counting unique values in a report

G

Guest

Hello,
I am using Access 2002.
As an example, 4 companies have a different number of contracts. The report
lists company name, contract number and dollar value of each contract.

In a header section for this group is a count of the number of unique
companies and total dollar value of all contracts.

Assuming the total number of records is 50 and they total to $500,000, the
header section would read:
Number of Companies: 4 Value of Contracts: $500,000

The Detail Section would read:
Company-1 001 $10,000
Company-1 002 $10,000
Company-1 003 $10,000
 
G

Guest

Create a query that groups by companies and make it simply count the
different records instead of showing them and implement this inside a
subreport.
 
M

Marshall Barton

J Glenn said:
I am using Access 2002.
As an example, 4 companies have a different number of contracts. The report
lists company name, contract number and dollar value of each contract.

In a header section for this group is a count of the number of unique
companies and total dollar value of all contracts.

Assuming the total number of records is 50 and they total to $500,000, the
header section would read:
Number of Companies: 4 Value of Contracts: $500,000

The Detail Section would read:
Company-1 001 $10,000
Company-1 002 $10,000
Company-1 003 $10,000
.
.
.
Company-2 004 $10,000
Company-2 005 $10,000
Company-2 006 $10,000
.
.
.
Company-3 007 $10,000
Company-3 008 $10,000
Company-3 009 $10,000
.
.
.
Company-4 010 $10,000
Company-4 011 $10,000
Company-4 012 $10,000
.
.
.
EOF

How do I count/calculate the number of unique companies (4)



Add a group level for the company field. Add a text box
named txtRunCompanyCount to this group's footer section and
set its control source expression to =1 with RunningSum to
Over Group.

After doing that, add a text box named txtCompanyCount to
your existing group footer with the expression
=txtRunCompanyCount

Your existing group header should be able to diplay the
total company count in a text box using the expression:
=txtCompanyCount
 

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