Question:
MS Access 2003 SUM Function?
Dee Devil
2009-07-08 01:56:12 UTC
I am a novice at MS access... I have a table which has survey IDs categorised into Different statuses (escalation/complaint/feedback) .. I have another table which gives me total surveys that came in on a particular day ... I need to add a column to this table with a count of all surveys in a specific category for the 1st table .... how do I go about it ?
Three answers:
Chris
2009-07-11 10:51:36 UTC
Well hello, Novice. Let me introduce you to your new best friend, the "Totals" query, which will allow you to crunch numbers in no time.



I'm assuming there is a field that joins the two tables together. If not, there may be a third ("Junction") table that creates the join. It would have an ID field from each table. You would add this table too, then join IDs to its matching field and SurveyCounts to its matching field.



Begin a new query in design view.

Add your ID table and your DailyCounts table and close the dialog box.

Make sure that the there is a join line connecting the common field in your ID table to the same field in your DailyTotals table.

In the ID field list, double click the Category field to add it to your query grid.

Double click the SurveyCount field to add it to the second column.

Click the "Totals" button on the toolbar, (the greek "Sigma" symbol)

A new row will appear in your query grid that will have "Group By" for both columns.

In the second column, in your query grid, change the "Group By" option to "Sum"

If you want to make the number crunchers really happy, you could add the SurveyCount field as many times as you want to and set the group by option to "MIN," MAX, AVERAGE, etc.



Save and run the query and you should have it.



Your next trick would be to check out the "Crosstab Query Wizard" which can be found by clicking Query, then the "New" button in the database window. You can't hurt anything by playing with it. If you don't like what it creates, just delete the query and go through the wizard again choosing different options.



Then, the magical Pivot Table and Pivot Chart.
cherria
2009-07-08 02:17:15 UTC
If you open the SQL view (left hand button on the toolbar) in the access queries screen and put this query in. Substitute your table name for 'surveys' and the status field name for 'status' then that should give you what you want.



SELECT status, count(status)

FROM surveys

GROUP BY status;
2016-10-06 07:38:44 UTC
on the question menu, open a query in layout veiw. you are able to desire to work out if there's a row for finished. If no longer, stunning click and choose finished. From there, it particularly is basically a drop down menu in the field you like. you additionally can create this feild in the rfile layout view.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Continue reading on narkive:
Loading...