Count

rookie_user1

Registered User.
Local time
Today, 06:12
Joined
Jul 14, 2006
Messages
22
Hi, I have a table which holds the months, and a distinct list of order_id.
On My Form I have a combo box where it displays the months of the year,
What i like is for when i select a month from the combo box for it to display the total count for that month.
 
Edit posting to make it more clear.

I've a query degined in access, that has 2 fields, Countoforders and month,
So far i have my combo box populated with the months thats in my query, but what i want to do is, when i select a month i want a text box to show me the Countoforders Example of query.

Countoforders Month
100 June
200 May

rookie_user1 said:
Hi, I have a table which holds the months, and a distinct list of order_id.
On My Form I have a combo box where it displays the months of the year,
What i like is for when i select a month from the combo box for it to display the total count for that month.
 
rookie is there anyway you can post your database so that I can have a look myself. Im not the best at figuring out what people are after. Cheers

Mike
 
Can post my db as the size limit won't allow, its only 1.19mb.

Here is my query for the combo box.

SELECT Distinct Belgium_Yearly_Orders_Count_Detial.Month FROM Belgium_Yearly_Orders_Count_Detial;

So this gives me e.g

June
May
April

What i want is to select a month from the combo and from the same query i have a total column select the total that is on the same row as the month,

Query


Count of Orders | Month
100 June
200 May
 
I understand now what you after I think. What you need is a GROUPBY statement in your SELECT statement. I have to go to work so I havent the time to look but if you type Count + Group + Months in the query thread then you should get a lot of results there as this is a common problem on this forum. I might be able to help you out later but Im afraid Ive got to go now. Hope you get there
 
Display results from combo box into a text box

Hi here is my query. See below, this give me the results i want to work with.

On my form i have a Combo box and a text box. if i select a month from the combo box i want the CountOfOrder to display in the text box, their will only be 12 rows in my query = 12 month and 12 CountOfOrder.

SELECT DISTINCT Count(Belgium_Yearly_Orders_Count.[Order ID]) As [CountOfOrder ID], Belgium_Orders_Yearly.Month
FROM Belgium_Orders_Yearly RIGHT JOIN Belgium_Yearly_Orders_Count ON Belgium_Orders_Yearly.[Sales Doc No] = Belgium_Yearly_Orders_Count.[Order ID]
GROUP BY Belgium_Orders_Yearly.Month;
 

Users who are viewing this thread

Back
Top Bottom