Problem Statement: I am trying to calculate the date difference for this patient to calculate the total hospital admission days. To calculate that i am considering patient's min start date and max end date and used the formula mentioned below:
This formula is working fine. but my problem is that for some patients the treatment happens multiple times and this formula will consider the min start date and max end date regardless of multiple treatments happened in different months.
I want to calculate the total hospital admission days for each patient using min start date and max end date but if the month is changed then it should calculate accordingly.