Solved

Total a column in an Access Query

Posted on 2014-03-26
7
1,820 Views
Last Modified: 2014-03-27
I am working on a report that will total individual inventory quantities from various locations. The results will be multiplied by the value to produce a total value amount. I have everything the way I need it except I need to total the quantities.

It would be acceptable to either do the total in the attached query or I can create a table and use that data to total the quantities.

I am attaching both the Access SQL and s sample of the results of the query (without the totals).

Need help.

tw
TotalQOH.txt
TotalQOH.xls
0
Comment
Question by:Tom Winslow
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 85
ID: 39956185
The results will be multiplied by the value to produce a total value amount
I'm not sure what you mean by that. You have several different calculated fields in the query.

Can you specify what you're looking for?

If you want to summarize the results, you'd be best to build a new query based on the one you're showing here. In that new query, you can then SUM the various fields for which you want to produce totals. For example, if you save your query above as 'qryRoot', then you could do this:

SELECT SUM(FrozenCost) AS FCSum, SUM(FrozenCostExt) AS FCExtSUM FROM qryRoot
0
 

Author Comment

by:Tom Winslow
ID: 39956229
For each occurance of IBITM, I need to total the QOH column. Example: For IBITM = 1321658, the total would be TotalQOH = 188.00 + 22.00 + 88.00 = 289.00. I only want to see a single line for each occurance of IBITM.
0
 

Author Comment

by:Tom Winslow
ID: 39956366
The code above:

SELECT SUM(FrozenCost) AS FCSum, SUM(FrozenCostExt) AS FCExtSUM FROM qryRoot

totals the entire column.

I am trying to get a separate total for each IBITM. In the example Excel sheet ther would be a total of six(6) lines instead of 29 lines where I am totaling only the column QOH.

Grouping IBITM and Summing QOH.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 38

Accepted Solution

by:
PatHartman earned 500 total points
ID: 39956439
Open the query in the QBE.  Click the big sigma button to make it a totals query.  Then change "Group By" to "Sum" for the columns you want to sum.

Keep in mind that you have several columns besides IBITM selected.  If they do not all have the same value for an IBITM, then you will end up with excess rows.   The query should only include the columns you need to group by and the columns you need to sum.
0
 

Author Closing Comment

by:Tom Winslow
ID: 39956509
What was I thinking?? yes. I need to break this into two (2) queries. Sum the quantities in the first and the calculate the values in the second. Thanks.
0
 
LVL 85
ID: 39957322
Did you select the right answer for this? Your last comment (i.e. "break this into two queries") is what I suggested first.
0
 

Author Comment

by:Tom Winslow
ID: 39958726
Scott, I think you are correct. Looking into a way to at least split the points.

tw
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question