-2

Hello!

Is it possible to exclude date intervals in MySQL. Let's say: I have picked two dates

start_date = "2013-04-02"

and

end_date = "2013-04-12"

The table reservation holds two columns for each item (items may not be with unique id's since many reservations are possible for a single item): reserved_from and reserved_until (both type = date).

Assume that for the first item

reserved_from = "2013-04-05" 

and

reserved_until = "2013-04-07

Is it possible to select all items that are NOT reserved between the start date and the end date ? What about multiple reservations and special cases (reserved_from < "start_date", etc. )

Thank you!

Doan Cuong
  • 2,594
  • 4
  • 22
  • 39
sitilge
  • 3,687
  • 4
  • 30
  • 56
  • Possible duplicate of [Select mysql query between date?](http://stackoverflow.com/questions/1469689/select-mysql-query-between-date) – sitilge Mar 28 '16 at 08:49

1 Answers1

0

Try:

Not between start_date and end_date

It will select all items where dates are not present in between both.

Dipali Nagrale
  • 510
  • 5
  • 17