$query_rs_reservations_meeting = "select min(rd_date_start) as min_rd_date_start, max(rd_date_finish) as max_rd_date_finish from thed_reservations_meeting_detail left
join thed_meeting_room on (thed_reservations_meeting_detail.mr_id=thed_meeting_room.mr_id)
where thed_reservations_meeting_detail.mr_id='$mr_id'
and thed_reservations_meeting_detail.rd_status=2
and (('$date_start' between thed_reservations_meeting_detail.min_rd_date_start and thed_reservations_meeting_detail.max_rd_date_finish) or ('$date_finish' between thed_reservations_meeting_detail.min_rd_date_start and thed_reservations_meeting_detail.max_rd_date_finish))";