Solved

Making a query that counts

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
Outlook Free & Paid Tools
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now