calendar

SET @start_date = CAST('2018-02-20 12:30:01' AS DATETIME);
SET @end_date = CAST('2018-02-20 14:29:59' AS DATETIME);
 
 
 
SELECT * FROM table
WHERE 
 
  (date_from > @start_date AND date_from < @end_date)
   OR 
  (date_to > @start_date AND date_from < @end_date)
  OR  
  (date_to > @start_date AND date_to < @end_date)
 
 
Kategoria: