I have table which contains 2 date fields. Like:
id from to
--- ---- --
1 2012-01-01 2012-01-05
2 2012-01-04 2012-01-10
3 2012-01-03 2012-01-07
I want to use a date (ex: 2012-01-06) to check if the date is between any of the dates(from, to) in the table.
For this case, I want to get id – 2,3. how can I do this?
or
http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html