I have check in and check out date for hotel, and I must count free night from checkin and split if checkin and checkout is different month.
case when DATEDIF