No good way to limit SQL search on events for recurring meetings?


Problem: I cannot figure out how to structure SQL statements to limit the amount of data loaded when searching against rec types to figure out when spaces are available….

Server (SQL)

Reservations (events) are saved in a SQL database against the shape of the scheduler event data object.


//where: if recurring end_date is the end of the series and event_length is needed to determine the length of that occurrence at that day in time, and when not recurring it’s the end of the meeting its self

User Case: A user wants to say “I need a meeting on this day at this time, that may or may not recur” …system give me all the conflict reservations so that I can see when time is available.

How can I search my database without loading every record……


User wants to reserve a space in April, that recurs 10 times.

Database has.

Existing recurrences that started in Jan that last the entire year…. As such I cannot limit my SQL search by the start date of the users request….to see conflicts

…Similarly I have to do the same thing with end date…using the same shape of the object in the scheduler the end date will be the end date of the series, not he date of the meeting….

Therefore I am left with having to use a HUGE result set and then loop through each record to see if it’s a conflict or not.

This also has implications on the Dynamic loading of the scheduler.

Any suggestions?



I can suggest you an implementation without searching in the database.

To find available spaces without events and deny creation of the 2nd event if some other event has already been defined at that time, you can use the [‘collision’ extension]. Read more details in the article (

Does this look like what you need?