Skip to content
Advertisement

Remove overlapping date intervals

I have two tables in my sql server database :

  • PlannedPeriods : containing periods of future events
  • UnavailabledPeriods : list or periods that are not available

Here’s an example for structure and data :

I would like to remove all unavailable periods from the planned periods in order to obtain this result :

Advertisement

Answer

In this case you should be able to collect all dates into a new table and work on it.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement