Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
This is with further reference to below thread;
Insert rows between two date ranges
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)
Thank You,
Senarath
RangeMax(0, RangeMin(vEnd_Date,[Actual Check Out Date]) - RangeMax(vStart_Date,[Actual Check In Date]))
if(e1>e2,e2,e1)-if(s1>s2,s1,s2)+1
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).
RangeMax(0, RangeMin(vEnd_Date,[Actual Check Out Date]) - RangeMax(vStart_Date,[Actual Check In Date]))
Hi Alex,
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.
Thanx
How are you going to acquire the dates from user? Control elements that change some variables?
Hi Marco,
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.
Many thanks