I am trying to make a query with overlapping dates. My tabel look like this'
Agenda ID DateStart DateEnd
-------------------------------------------------------
1 2012-04-02 08:00:00 2012-04-02 11:30:00
2 2012-04-02 10:00:00 2012-04-02 13:00:00
3 2012-04-02 12:00:00 2012-04-02 15:00:00
This data is for planning activities. You can't plan a activity if the time overlaps. In this case all the times overlap. But he compares it to the one you planned earlier. Say I planned ID 1, so I can't plan ID 2, But I can plan ID 3.
How Can I write A query with php to select the items that overlap. Thank you very much
SELECT
agenda.DateStart,
agenda.DateEnd,
agenda.AgendaID
FROM
AGENDA
WHERE
????
AND
????