Forum Discussion
Days Fleet Vehicle Available For Each Month
- 6 years ago
Hello
I have a table similar to this
| License plate | March | Registration Date | Low Date |
| 0557LWD | VW LCV | 02/02/2022 04:02:32 | |
| 0706LNS | VOLKSWAGEN | 26/05/2022 09:05:21 | |
| 0825LWR | VW LCV | 11/03/2022 10:03:48 | |
| 0841LPK | VOLKSWAGEN | 19/07/2022 03:07:34 | |
| 1137LNJ | VW LCV | 31/03/2021 04:03:27 | |
| 0006LBN | VOLKSWAGEN | 07/10/2019 06:10:09 | 04/09/2020 00:00 |
| 0007LBN | VOLKSWAGEN | 10/10/2019 12:10:59 | 27/08/2020 00:00 |
| 0009LBN | VOLKSWAGEN | 07/10/2019 06:10:49 | 31/08/2020 00:00 |
| 0010LBN | VOLKSWAGEN | 10/10/2019 12:10:03 | 13/01/2021 00:00 |
| 0014LBN | VOLKSWAGEN | 08/10/2019 12:10:44 | 04/07/2020 00:00 |
| 0056KMW | VOLKSWAGEN | 23/10/2019 11:10:49 | 13/12/2019 00:00 |
| 5579LJK | VOLKSWAGEN | 25/08/2020 04:08:49 | 08/10/2020 00:00 |
| 5585LNV | SEAT | 14/03/2022 12:03:19 | 21/06/2022 00:00 |
| 5587LNV | SEAT | 22/03/2022 03:03:25 | 13/05/2022 00:00 |
I replace the blank cells with the last day of the full month for which I have data, in this case 31/8/22.
I am interested in knowing about each car the days it has been active (difference between date of registration and date of cancellation), by year and month and to be able to compare it with the days it has been in use or rented. Usage or rental data comes from another table where the issued contracts are collected. In this way you would have the occupation or rate of use of each car, by day, week, month, year, etc.
The correct result of occupancy days by month and year should be something like this:
| Year 2022 | |||||||||
| License plate | January | February | March | April | May | June | July | August | September |
| 0557LWD | 0 | 27 | 31 | 30 | 31 | 30 | 31 | 31 | |
| 0706LNS | 0 | 0 | 0 | 0 | 6 | 30 | 31 | 31 | |
| 5585LNV | 0 | 0 | 18 | 30 | 31 | 21 | 0 | 0 | |
| 5587LNV | 0 | 0 | 10 | 30 | 13 | 0 | 0 | 0 |
|
I hope I have been able to explain myself.
Thanks a lot.
- Syndicate_Admin3 years ago
Administrator
Fantastic!!!
It has served me and a lot.
I have it solved.
Thank you so much!!
- Ashish_Mathur3 years ago
Super User
You are welcome. If my reply helped, please mark it as Answer.