Solved

Please help with a Query

Posted on 2014-04-22
4
201 Views
Last Modified: 2014-04-22
Experts please help me. I have a table with two fields that I need to work with.
1. GroupID
2. InventoryID

The table might look something like this

GroupID     InventoryID
1                  43
1                  22
1                  23
1                  67
1                  55
3                  21
3                  13

I need a query to return the number of inventoryID's for each type of group in the table.
0
Comment
Question by:Basicfarmer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 300 total points
ID: 40016078
Try this SQL:

SELECT TableA.GroupID, Count(TableA.InventoryID) AS CntInvID
FROM TableA
GROUP BY TableA.GroupID;

Change TableA to your table name.

mx
0
 
LVL 19

Assisted Solution

by:Raheman M. Abdul
Raheman M. Abdul earned 100 total points
ID: 40016079
Try this:
select groupid, count(inventoryid) as 'TotalInventoryIDs' from tablename groupby groupid
0
 
LVL 34

Assisted Solution

by:Norie
Norie earned 100 total points
ID: 40016082
Try this.

SELECT GroupID, Count(GroupID)
FROM [YourTable]
GROUP BY GroupID
0
 

Author Closing Comment

by:Basicfarmer
ID: 40016089
Thanks for the quick replies. You all had the same thing thing so a gave more points to DatabaseMX since he was first.

Thanks again...
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error import assembly 19 26
How do I "share" on social sites? 2 38
Tabbed form question 5 20
Help with modifying xml file using VB.NET 5 8
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
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 …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

734 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