Solved

Making a query that counts

Posted on 2012-03-15
5
268 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

830 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