Testing for Overlapping Events with SQL
Asked by Dave Abad
19 years ago.
19 years ago.
I know this is way sort of off topic but like the rest of you I'm developing a time / event scheduling app so I though I might save you some time and post this thing I've been banging my head against the wall working on. Namely since my app is being used to keep track off billable time I needed a way to make sure new events do not overlap any existing ones in my database.
Here's the SQL...
SELECT eventid from events WHERE(NOT((event_end < '" & newEventStartDate & "')
OR (event_start > '" & newEventEndDate & "')));"
Hope you find this helpful.
Dave
Here's the SQL...
SELECT eventid from events WHERE(NOT((event_end < '" & newEventStartDate & "')
OR (event_start > '" & newEventEndDate & "')));"
Hope you find this helpful.
Dave
DayPilot