Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting processes each time

Status
Not open for further replies.

118600

Vendor
Feb 15, 2005
36
0
0
DE
Hi,

My problem is

1- Can I get number of orders according
to Order_Nr (i.e for Order_Nr 100 I have here 3 Orders )
2- Total number of orders at the end processed in the whole process.

Serial_Nr Order_Nr Cost Date Count_Orders
1 100 20 01.06.04
2 100 40 01.08.04
3 100 50 01.09.04
4 200 10 03.10.04
5 200 30 14.11.04
6 300 20 15.12.04
7 300 30 30.12.04
8 300 10 02.01.05
9 400 10 15.01.05
10 400 20 20.01.05


Cheers,

 
SELECT Order_Nr, Count(*) As Count_Orders FROM tblOrders
UNION SELECT 0, Count(*) FROM tblOrders;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
slight modification:

SELECT Order_Nr, Count(*) As Count_Orders FROM tblOrders GROUP BY Order_Nr
UNION SELECT 0, Count(*) FROM tblOrders;

Leslie
 
Good catch Leslie. (more coffee needed ...)
 
Good catch Leslie. (more coffee needed ...)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Cheers PHV (MIS) and lespaul (Programmer)

Its working. One Question

Can i get these two tasks in two different queries. such that if i say " Sum of oder_Nr....." just type it and i get the total number of Orders of that Order_Nr.

Secondly, if i can get the whole sum of whole order_Nrs.

Thanks, you are doing a great job.

 
You may consider the DLookUp function too.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
not often I catch an error in one of your posts!!! You definitely need more coffee.

118600 - do you mean you want to prompt the user for the order number?

SELECT Order_Nr, Count(*) As Count_Orders FROM tblOrders WHERE Order_Nr = [Enter Order Number to Count] GROUP BY Order_Nr

Do you want to COUNT or SUM?

Leslie
 

Leslie, i dont think that coffee will effect me, i am not a programmer like you guys.

Actaually its a sum, the total number of orders....

Thanks again Leslie and PHV

 
Not me, coffee is NASTY!!! PHV said he needed some though!



Leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top