I have had a lot of trouble with this particular query.
Here is what I want...
The 3 largest downtime reasons for each date, shift, machine combination.
I have a table that has these fields:
tbl1ID
date
shift
machine
I have a 2nd table that has these fields:
tbl2ID
downtimeMinutes
downtimeReason
tbl1IDreference
There could be many downtime reasons associated with each date, shift, machine combination.
I want to only show the top 3 for each date, shift, machine combination.
I am a novice. The only way I could think of accomplishing this is by using a union on all combinations of date, shift, and machine. Each union would show the top 3 downtime reasons for that combination.
Each day/shift/machine combination could have 3 different downtime reasons listed.
Could someone show me how to construct a query to do this?
Here is what I want...
The 3 largest downtime reasons for each date, shift, machine combination.
I have a table that has these fields:
tbl1ID
date
shift
machine
I have a 2nd table that has these fields:
tbl2ID
downtimeMinutes
downtimeReason
tbl1IDreference
There could be many downtime reasons associated with each date, shift, machine combination.
I want to only show the top 3 for each date, shift, machine combination.
I am a novice. The only way I could think of accomplishing this is by using a union on all combinations of date, shift, and machine. Each union would show the top 3 downtime reasons for that combination.
Each day/shift/machine combination could have 3 different downtime reasons listed.
Could someone show me how to construct a query to do this?