OVERLAPS for Informix

date formatinformix

Does Informix have a function equivalent to OVERLAPS, which finds out whether or not two time intervals have any time in common?

Best Answer

I don't think there is a OVERLAPS() function that you could use. You'll have to stick to the usual test:

WHERE a.StartTime < b.EndTime
  AND b.StartTime < a.EndTime

Change < to <=, depending on how you want your Overlap test to function on end cases, when an end time (or date) is exactly the same as the other start time. I guess such behaviour may be wanted for dates.