Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
aggregate query
Tim Elbert 
      
2 years ago
I have a query that shows the sum of each item in one field with the itemIds in ten other fields.  I would like to query this to show the total number of each item represented, by the item number (see excel sample in photo).  Each ItemId represents one item but can show up in any of the ten fields depending on how they are ordered. (Each item is a plant and each field is a location so depending on how they want it planted, each item can be used in any or all of the fields.  I need each item (1) to be multiplied by the sum(Field1) and then added together with all the others of the same item number for a total number of each Item (again, see excel sample).  Can this be done with an aggregate query and if so, please help me with the formula.
If this cannot be done in one step in an aggregate query, what would be the steps to get this?
Thank you.
Tim Elbert OP  @Reply  
      
2 years ago

Juan C Rivera  @Reply  
            
2 years ago
Can you show the tables and the relashipship.  I like to try and make a better understanding of how this is set up. but off the top of my head I think your ID is missing.  try this video to see if it helps
Relationships

Tim Elbert OP  @Reply  
      
2 years ago
Hi Juan
I am not sure how that will help.  I might not be asking the question correctly, or perhaps I am misunderstanding something.  The relationships are there and the information is all correct, I just need it shown in a different manner.  Each number in the 'Plug' feilds are the PlantId that represents a specific plant, and each field represents a specific location.  Each line represents a specific sales order.  I just need to know how many there are of each specific plant in the whole table.  I could do a COUNT formula but there is the 'sumoftotal'  column that represents how many are on that specific order.  The excel table on the right represents the 'look' I am looking for.
Kevin Yip  @Reply  
     
2 years ago
You may need to re-design your table structure.  Access (or any relational database system) can only count rows in an aggregate queries, not columns.  So your table needs to be more "row-oriented" so that rows can be counted.  For instance.  E.g.:

Instead of this:

Plug1   Plug2   Plug3
137     138     139

do this:

PlugNum   PlantID
1         137
2         138
3         139
Tim Elbert OP  @Reply  
      
2 years ago
Thanks Kevin, that is quite helpful.  I will work on that.
Richard Rost  @Reply  
          
2 years ago

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/6/2026 4:38:58 AM. PLT: 1s