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

Sum a calculated control in a report?

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
I'm having problems producing a grand total which is a sum of a calculated control.

I know this is an issue with MS Access as I found this on the MS website
but their solution will not work because the calculated control is actualy a count to give a group subtotal using a control source of =1 and running sum = group

so i cannot reproduce the calculation in the grand total sum as per their suggestion.

How can I sum the total of a calculated group sub total field to give a grand total?

many thanks

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
You can use Count, rather than Running Sum to get the count. What is the calculation you wish to do?
 
I am counting how many unique records are in a group, but want a total of those as a grand total at the end.

The way I endend up doing this was a DCOUNT , the problem being access kills the sum on each new group and so it is not available to add up at the end of the report.

Count would not work because there are duplicate records for each company and so doing a simple count gives me the total records, not the total number of companies.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Count would not work because there are duplicate records for each company and so doing a simple count gives me the total records, not the total number of companies.

a query like this will give a total number of companies:
Code:
SELECT Count(*) FROM (SELECT DISTINCT CompanyName FROM TableName)


Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases:
The Fundamentals of Relational Database Design
Understanding SQL Joi
 
yup that's why I went for the dcount option.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top