Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
How are you storing these time intervals? In two columns, say StartTime and EndTime? – ypercubeᵀᴹ Mar 29 '12 at 20:10
Exactly, two columns from two different tables with start and end dates. – newenglander Mar 30 '12 at 8:05
up vote 1 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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