SELECT * FROM roomstatus
WHERE
STR_TO_DATE('2012-04-02' , '%Y-%m-%d') BETWEEN STR_TO_DATE(rs_datein,'%Y-%m-%d') AND STR_TO_DATE(rs_dateout,'%Y-%m-%d')
OR
STR_TO_DATE('2012-04-02' , '%Y-%m-%d') BETWEEN STR_TO_DATE(rs_datein,'%Y-%m-%d') AND STR_TO_DATE(rs_dateout,'%Y-%m-%d')
STR_TO_DATE('2012-04-02' , '%Y-%m-%d') BETWEEN STR_TO_DATE(rs_datein,'%Y-%m-%d') AND STR_TO_DATE(rs_dateout,'%Y-%m-%d')
OR
STR_TO_DATE('2012-04-02' , '%Y-%m-%d') BETWEEN STR_TO_DATE(rs_datein,'%Y-%m-%d') AND STR_TO_DATE(rs_dateout,'%Y-%m-%d')
SELECT * FROM roomstatus
WHERE
(
STR_TO_DATE(rs_datein,'%Y-%m-%d') BETWEEN STR_TO_DATE('2012-03-31', '%Y-%m-%d') AND STR_TO_DATE('2012-04-05', '%Y-%m-%d')
OR
STR_TO_DATE(rs_dateout,'%Y-%m-%d') BETWEEN STR_TO_DATE('2012-03-31', '%Y-%m-%d') AND STR_TO_DATE('2012-04-05', '%Y-%m-%d')
)
OR
(
STR_TO_DATE('2012-03-31', '%Y-%m-%d') BETWEEN STR_TO_DATE(rs_datein,'%Y-%m-%d') AND STR_TO_DATE(rs_dateout,'%Y-%m-%d')
OR
STR_TO_DATE('2012-04-05', '%Y-%m-%d') BETWEEN STR_TO_DATE(rs_datein,'%Y-%m-%d') AND STR_TO_DATE(rs_dateout,'%Y-%m-%d')
)