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

Access totals query (sum) duplicates values in report

Status
Not open for further replies.

OQuigley

Programmer
Aug 13, 2008
1
0
0
US
Greetings. Let me start the question with the final product, and explain in reverse back to the tables. The product is an Access report that shows one line for each building, with summaries of four types of data for that building. For example, the types might be "Estimates," "Proposals," "Invoices," etc.

The report is powered by a query which is composed of a query for the building descriptions, and then sum totals queries by building, one query for each data type (one sum query for "Estimates," one for "Proposals," etc).

Each sum totals query is simply a query showing totals (sum) for a basic table holding details, and a related subtable with the value. For example, the Estimates are in a table called tEst, and the values are in a subtable called tEstDet. So if there are many estimates per building, this query will total the values for each building.

My problem is that in the final query that runs the report, the Estimate value for a building, although summed correctly in the lower queries, sometimes might show a double or triple value of the correct sum. And, of course, this inflated value shows up in the report.

Also, for the record, all queries were producing correct numbers after I made them using data I already had. The problem arises with some buildings and not others, after new data are added.

I understand that if a grouping in a sum query is related to a table/query with multiple items for that grouping, the grouping will display as many times as there are items in the other object. I took pains to work around this. The report (and queries) were functioning. Somehow adding data makes the totals display more than once. I'm fairly perplexed, and appreciate some insight. Thank you very much.
 
You have a query problem. Please repost in forum701 and include the SQL statement of your query (use the drop down toolbar icon that swiches between design and datasheet view to select SQL) that is producing repeated results and describe what it is the query is supposed to do or is doing that it shouldn't. If there are queries based on queries include those query names along with their SQL statments.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top