473,387 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Count number of items in a query

12
Hi,

I am creating a query where I would like to count the number of specific items in a certain column of another query. I can do this for one item, for example:

SELECT DISTINCTROW[Item List].[Discussion Item], Count([Item List].[State]) AS [Delivered Items]
FROM [Item List]
WHERE (([Item List].[Discussion Item])="Yes") AND (([Item List].[State])="DELIVERED")
GROUP BY [Item List].[Discussion Item];

But, how do I do this for multiple items?

Thanks for your help!!
Sep 19 '06 #1
2 3473
PEB
1,418 Expert 1GB
Hi,

In fact you can do it with subqueries:

In a query based on your information source

And in the field row you can put:

Count1:(SELECT DISTINCTROW Count([Item List].[State]) AS [Delivered Items]
FROM [Item List]
WHERE (([Item List].[Discussion Item])="Yes") AND (([Item List].[State])="DELIVERED") AND (([Item List].[Discussion Item])=[My_source].[Discussion Item] )
GROUP BY [Item List].[Discussion Item])

:)

Have a nice day!
Sep 21 '06 #2
AZKing
12
Thank you very much, it worked great!!
Sep 21 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Anne | last post by:
Hi I have got a table with some sales transactions. It has got 3 fields 1) Ordernumber 2) Item number 3) Shippingdate Now I want to make ONE (not two) query that shows how many different...
2
by: Paula | last post by:
A query contains the fields CustomerID, CustomerName, OrderID, OrderDate and ItemID. The query is based on a customers table, orders table, and order details table. The orders table has a foreign...
0
by: chris.bender | last post by:
1. My problem: I am using a query to populate a Chart in MS Access 2k. 2. My query: SELECT .Status, ., Sum(.Amount) AS SumOfAmount, Sum(IIf(!="Debit",!,!*-1)) AS realAmount, Count(.Status) AS...
9
by: Terry E Dow | last post by:
Howdy, I am having trouble with the objectCategory=group member.Count attribute. I get one of three counts, a number between 1-999, no member (does not contain member property), or 0. Using...
2
by: Pikarde | last post by:
I made a search page that will display items matching the users input. It will display 8 items per page. So paging is a must. I'm migrating the page from asp to asp.net in asp it's very easy to...
3
by: Miguel | last post by:
I have a parameter query to filter by date from which I run a report. I need to be able to count the number of times a particular product or error type appears after the report is run from the...
4
by: rdraider | last post by:
We have an inventory table (Items) that contains item_no and qty_on_hand fields. Another table (Item_Serial) contains serial numbers for any item that has serial numbers. If an item has 10...
5
by: Genalube | last post by:
I am trying to count the number of owners that show up in a query (conveyQuery). The query will produce a column OwnName that will contain names like John Smith, Mike Jones, Frank Vaugn. Each of...
1
by: nospam | last post by:
I have a report to count some statistics of case data. I can't figure out how to make Access group and sum/count information to give me a nice statistics report. Basically the database has case...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.