2

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

2
  • How are you storing these time intervals? In two columns, say StartTime and EndTime? Mar 29 '12 at 20:10
  • Exactly, two columns from two different tables with start and end dates. Mar 30 '12 at 8:05
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.