Solved

Making a query that counts

Posted on 2012-03-15
5
262 Views
Last Modified: 2012-06-21
I need a query for the field,” defect category”,( that is a dropdown). All the values in the drop down should be broken down in their category . Then I need the totals of each category. Then I need to take that query and make a report. For example:

LOCATION        DEFECT CATEGORY
Korea                    broken
Korea                    broken
                             Total: 2
Colorado                 Leakage
                             Total: 1
I have enclosed my database for further explanation.
Inventory-db.accdb
0
Comment
Question by:gigifarrow
5 Comments
 
LVL 10

Expert Comment

by:MadShiva
ID: 37725099
Dear gigifarrow,

I have modify your file.

Please let me know if it's was you expected.

Best Regards
Inventory-db.accdb
0
 
LVL 77

Expert Comment

by:peter57r
ID: 37725103
You create a query that gives you the list of records to be reported.  Then use the report wizard to build your report from this query and include a Group by location and specify a count of Defect Category as you go through the wizard.
0
 

Author Comment

by:gigifarrow
ID: 37725195
thank you for your help. it is halfway right. I do apologize if I wasnt clear. I need a total of each defective category then a grand total all together. This one shows the quantity for each, but doesnt total for each defect.
0
 
LVL 8

Assisted Solution

by:Leo Torres
Leo Torres earned 100 total points
ID: 37725221
Just as a tip before you go on any further.. I would fix table design.. This design will cause you many pains going forward. Its best to fix it now. What I mean is the table relationships.. The tables have to be Normalized.

For example location and defects are what I see since I tried to do this query for you.
in the Inventory_tbl and Location_tbl should be linked by an ID in the Location_tbl. You have the location in the Inventory table which beats the point of having a location Table..
In the Inventory table you should have IDs that match back to location table..

The Same can be said for defects makes no sense to have a defect table if the dects description is in the inventory table. Place those descriptions in the defect table and reference them via the ID in the inventory table  

This is called 2NF (2nd Normal Form)
Look into Normalization of your database design
here is a link
http://www.youtube.com/watch?v=uO80f642LCY

Once that has been done your query building will fall in place
0
 
LVL 10

Accepted Solution

by:
MadShiva earned 400 total points
ID: 37725229
Ok. I have made the change. but you lose the location. If it's not what you want please make again another example.
Inventory-db.accdb
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

785 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