Description
Returns the duration in milliseconds of the overlap between all intervals in the function's arguments.
This function takes an even number of arguments and returns the duration in milliseconds of the overlap between all intervals. If the intervals do not overlap, then 0 is returned.
Syntax
IntervalIntersection(interval1_start, interval1_end, interval2_start, interval2_end […)
Arguments
interval1_start - datetime expression representing the start of the first interval.
interval1_end - datetime expression representing the end of the first interval.
interval2_start - datetime expression representing the start of the second interval.
interval2_end - datetime expression representing the start of the second interval.
intervalN_start - datetime expression representing the start of the Nth interval.
intervalN_end - datetime expression representing the end of the Nth interval.
Examples
IntervalIntersection(ToDate('2013-09-10T08:00:00.000Z'), AddDuration(ToDate('2013-09-10T08:00:00.000Z'),'PT10M'), ToDate('2013-09-10T08:05:00.000Z'), AddDuration(ToDate('2013-09-10T08:05:00.000Z'),'PT10M'))
returns 300000 (5 minutes).
Return value datatype
Long
Impact of null value
If any of the inputs is null, returns null.