Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Making a query that counts

Posted on 2012-03-15
5
Medium Priority
?
294 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:Tobias
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 400 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:
Tobias earned 1600 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Microsoft has changed the look and feel of Azure AD and Microsoft account sign-in pages so that you will have a more unified look and feel when moving between the two interfaces.
Quickbooks hosting can do wonders to your enterprise but considering the points elaborated in the article which will help you to better analyze the outcomes. So scan your business, its needs and then move to the new world of limitless benefits.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

885 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