Toll Booth Willie
Welcome to Wusta!
- Joined
- Jan 8, 2003
- Posts
- 3,441
- Reaction score
- 0
- Points
- 36
- Age
- 48
- Location
- Des Moines, IA
- Website
- Visit site
Need to write a query in MS Access to accomplish the following:
As many of you know, I am an automation engineer at a Dairy distribution warehouse. We have two main tables, a completions table with past orders that have been picked, and an orders table with orders that are currently being processed. To gauge system efficiency, we need to be able to look at previous days' orders for order lines where a single case was picked, vs 2 cases picked, vs 3 cases picked (more cases picked simultaneously = higher efficiency) and so on. If I pick more than one case at once, all the cases will have the same orders_id. I need a query that shows me, for a given route, how many picks were single picks, how many were double picks and so forth. Table looks like:
ORDERS_ID ROUTE STOP SKU QTY
868544337 233 1 200111 1
868544337 233 1 200111 1
868544337 233 1 200111 1
868544338 233 1 201259 1
868544338 233 1 201259 1
868544339 233 2 200003 1
So the desired output of the query would tell me for route 233 I had 1 instance of a 3 case pick (for SKU 200111), one instance of a 2 case pick (for 201259) and 1 instance of a single case pick (for 200003). Basically I want to count the number of instances of each unique orders_id (I see 868544337 3 times, 868544338 2 times and so on). Hope I'm not confusing the crap out of everyone. Any suggestions?
As many of you know, I am an automation engineer at a Dairy distribution warehouse. We have two main tables, a completions table with past orders that have been picked, and an orders table with orders that are currently being processed. To gauge system efficiency, we need to be able to look at previous days' orders for order lines where a single case was picked, vs 2 cases picked, vs 3 cases picked (more cases picked simultaneously = higher efficiency) and so on. If I pick more than one case at once, all the cases will have the same orders_id. I need a query that shows me, for a given route, how many picks were single picks, how many were double picks and so forth. Table looks like:
ORDERS_ID ROUTE STOP SKU QTY
868544337 233 1 200111 1
868544337 233 1 200111 1
868544337 233 1 200111 1
868544338 233 1 201259 1
868544338 233 1 201259 1
868544339 233 2 200003 1
So the desired output of the query would tell me for route 233 I had 1 instance of a 3 case pick (for SKU 200111), one instance of a 2 case pick (for 201259) and 1 instance of a single case pick (for 200003). Basically I want to count the number of instances of each unique orders_id (I see 868544337 3 times, 868544338 2 times and so on). Hope I'm not confusing the crap out of everyone. Any suggestions?
Last edited:
:huh: