I am trying to calculate the number of days that happen in each year when the range crosses a year boundary.
Examples are
| handover_datetime | return_datetime |
| 12/3/2022 11:30 | 1/21/2023 18:58 |
| 12/5/2022 14:00 | 1/5/2023 14:00 |
| 12/26/2022 8:30 | 12/31/2022 17:55 |
| 12/15/2022 13:30 | 1/16/2023 8:46 |
| 12/10/2022 13:41 | 1/23/2023 12:00 |
I have been trying to use a flag to see when the return date is and then calculating using DateTimeDiff against Jan 1 or the relevant column, but nothing seems to be working perfectly. I am attaching my sample data and the formulas I am trying to use.