Running Count Of order by customer!

Wolf

Registered User.
Local time
Today, 14:05
Joined
Oct 24, 2012
Messages
30
I searched and searched but cant seem to find this anywhere.
I have a parent table called customer name that has ID name phone etc, then I have a orders table with 3 fields in it Order ID (autonum), Customer ID, and order date.

Now I would like to create a query with all orders from the second table and count them by customer ID,
For example
John Doe Order ID 15, 1
John Doe Order ID 35, 2
John Doe Order ID 67, 3
Irvin Lew Order ID 25, 1
Irvin Lew Order ID 29, 2
Isibela Bore Order ID 99, 1
Isibela Bore Order ID 76, 2
Isibela Bore Order ID 85, 3
And so on....
Of course I want it sorted by date so it will give the number of orders each customer ordered prior to the one im looking at.


But using the Dcount or Count function only gives me a total orders for ea cust.
 
This article should get you started, however you will have to do a little work to expand it to produce the results you are after.
 
This article should get you started, however you will have to do a little work to expand it to produce the results you are after.

I have already read this article, the problem with these methods is that it won't let you restart the count for each employee.
I need the running count to restart for every customer. Or for the example used in that article for each employee.
 

Users who are viewing this thread

Back
Top Bottom