Hello,
I am after some assistance in getting some information out of my database which is causing me some problems.
My data shows each individual journey that a truck has taken and I am trying to show the number of journeys each truck did in a given county on a given day and a given shift. I've given an example of the data below as well as the desired output. My understanding with vba is limited and have mostly used queries in Access so I'm a little stuck here but am more than willing to learn so any help is gratefully received.
Thanks.
I am after some assistance in getting some information out of my database which is causing me some problems.
My data shows each individual journey that a truck has taken and I am trying to show the number of journeys each truck did in a given county on a given day and a given shift. I've given an example of the data below as well as the desired output. My understanding with vba is limited and have mostly used queries in Access so I'm a little stuck here but am more than willing to learn so any help is gratefully received.
Thanks.
Book1 | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | Data | ||||||
2 | |||||||
3 | County | Date | Shift | Registration | Use | ||
4 | Cornwall | 01/04/2020 | DAY | BCA478 | FALSE | ||
5 | Cornwall | 01/04/2020 | DAY | DDD543 | TRUE | ||
6 | Cornwall | 01/04/2020 | DAY | XYZ999 | TRUE | ||
7 | Cornwall | 01/04/2020 | NIGHT | DDD543 | TRUE | ||
8 | Cornwall | 01/05/2020 | DAY | DDD543 | TRUE | ||
9 | Cornwall | 01/05/2020 | DAY | DDD543 | TRUE | ||
10 | Cornwall | 01/05/2020 | DAY | DDD543 | TRUE | ||
11 | Cornwall | 01/05/2020 | NIGHT | AAA111 | TRUE | ||
12 | Cornwall | 01/05/2020 | NIGHT | ABC123 | TRUE | ||
13 | Devon | 01/04/2020 | DAY | ABC123 | TRUE | ||
14 | Devon | 01/04/2020 | DAY | XYZ999 | TRUE | ||
15 | Devon | 01/04/2020 | NIGHT | ABC123 | FALSE | ||
16 | Devon | 01/04/2020 | NIGHT | ABC123 | TRUE | ||
17 | Devon | 01/04/2020 | NIGHT | BCA478 | TRUE | ||
18 | Devon | 01/04/2020 | NIGHT | XYZ999 | TRUE | ||
19 | Devon | 01/05/2020 | DAY | ABC123 | TRUE | ||
20 | Devon | 01/05/2020 | DAY | BCA478 | TRUE | ||
21 | Devon | 01/05/2020 | NIGHT | AAA111 | TRUE | ||
22 | Devon | 01/05/2020 | NIGHT | AAA111 | TRUE | ||
23 | Devon | 01/05/2020 | NIGHT | ABC123 | TRUE | ||
24 | Devon | 01/05/2020 | NIGHT | ABC123 | TRUE | ||
25 | Devon | 01/05/2020 | NIGHT | ABC123 | TRUE | ||
26 | |||||||
27 | |||||||
28 | Output | ||||||
29 | |||||||
30 | County | Date | Shift | Registration | Jobs per county, day, shift | ||
31 | Cornwall | 01/04/2020 | DAY | DDD543 | 1 | ||
32 | Cornwall | 01/04/2020 | DAY | XYZ999 | 1 | ||
33 | Cornwall | 01/04/2020 | NIGHT | DDD543 | 1 | ||
34 | Cornwall | 01/05/2020 | DAY | DDD543 | 3 | ||
35 | Cornwall | 01/05/2020 | NIGHT | AAA111 | 1 | ||
36 | Cornwall | 01/05/2020 | NIGHT | ABC123 | 1 | ||
37 | Devon | 01/04/2020 | DAY | ABC123 | 1 | ||
38 | Devon | 01/04/2020 | DAY | XYZ999 | 1 | ||
39 | Devon | 01/04/2020 | NIGHT | ABC123 | 1 | ||
40 | Devon | 01/04/2020 | NIGHT | BCA478 | 1 | ||
41 | Devon | 01/04/2020 | NIGHT | XYZ999 | 1 | ||
42 | Devon | 01/05/2020 | DAY | ABC123 | 1 | ||
43 | Devon | 01/05/2020 | DAY | BCA478 | 1 | ||
44 | Devon | 01/05/2020 | NIGHT | AAA111 | 2 | ||
45 | Devon | 01/05/2020 | NIGHT | ABC123 | 3 | ||
Sheet1 |