473,569 Members | 2,648 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Count number of items in a query

12 New Member
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 3481
PEB
1,418 Recognized Expert Top Contributor
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 New Member
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
5089
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 orders quarterly, and at the same time how many different item numbers used in each quarter.
2
4266
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 key of CustomerID and is joined to CustomerID in the customer table. The order details table has a foreign key of OrderID and is joined to OrderID...
0
1486
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 CountOfStatus FROM ( INNER JOIN ON .Status = .) INNER JOIN ON (. = .) AND (. = .EffectiveDate)
9
10819
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 LDIFDE as a comparison I get the same results. No members means just that, an empty group. Zero means that the DirectorySearcher.SizeLimit has been...
2
1825
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 call an sql statement as followed " select count(*) as allitems from items where sku=' " & request.form("search") & "' " i then retireve allitems...
3
4295
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 query. The products and error types are limited to a defined list. I need to put these summary totals in the footer. Using the Dcount function works,...
4
2789
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 qty_on_hand, it should have 10 records in Item_Serial, one unique serial number for each item. I am trying to find items where the number of serial...
5
2493
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 these names may show up several times and the sorting is such that all the items that person owns will group together. There is a field callled...
1
3036
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 information for matters at a law firm. The point is to create this report to group on the attorney. Then for each attorney count the cases where...
0
7701
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7615
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8130
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
940
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.