This is with further reference to below thread;
I want to get the count of days which overlap between below two date ranges. (Inclusive of first and last dates)
Eg. Select vStart_Date - Select vEnd_Date (01-Jan-14 to 04-Jan-14)
Actual Check In Date - Actual Check Out Date (02-Jan-14 to 06-Jan-14)
I want to get the overlapping count as 03 days ( 02-Jan-14 to 04-Jan-14 inclusive of both days)
is that OK? Assuming s1 = Select vStart_Date, e1 = Select vEnd_Date, s2 = Actual Check In Date, e2 = Actual Check Out Date...
And you should check it for positive results, of course (negative will mean lack of intersection).
I tried this and did not work because the date selection can be varied according to user. We cannot predefined which date going to be less than what.
Let me try out other answers and give a feedback.
I applied your answer and it works. However, as I wanted both days inclusive, I modified it as below by adding 1
and figures seem ok.
RangeMax(0, RangeMin(vEnd_Date+1,[Actual Check Out Date]+1) - RangeMax(vStart_Date,[Actual Check In Date]))
Hope, technically this is ok.