Take the 2-minute tour ×
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. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.