How to determine if a date range occurs any time within another date range?

前端 未结 5 1622
星月不相逢
星月不相逢 2021-02-02 04:07

I have an Event table that specifies a date range with start_date and end_date fields. I have another date range, specified in code, that defines the

5条回答
  •  余生分开走
    2021-02-02 04:38

    (end2 >= start1) && (start2 <= end1) I think would return true for any intersecting date ranges.

    I found a discussion about this here that I found useful.

提交回复
热议问题