create table rezervare (
id int auto_increment,
check_in varchar(10),
checkout varchar(10),
primary key (id)
);
insert into rezervare values
(null, '12-03-2015', '12-03-2015'),
(null, '13-03-2015', '13-03-2015'),
(null, '14-03-2015', '14-03-2015'),
(null, '15-03-2015', '15-03-2015'),
(null, '16-03-2015', '16-03-2015'),
(null, '17-03-2015', '17-03-2015'),
(null, '19-03-2015', '19-03-2015'),
(null, '20-03-2015', '20-03-2015')
;
select * from rezervare;
+----+------------+------------+
| id | check_in | checkout |
+----+------------+------------+
| 1 | 12-03-2015 | 12-03-2015 |
| 2 | 13-03-2015 | 13-03-2015 |
| 3 | 14-03-2015 | 14-03-2015 |
| 4 | 15-03-2015 | 15-03-2015 |
| 5 | 16-03-2015 | 16-03-2015 |
| 6 | 17-03-2015 | 17-03-2015 |
| 7 | 19-03-2015 | 19-03-2015 |
| 8 | 20-03-2015 | 20-03-2015 |
+----+------------+------------+
If your schema same as this, you can't use date function, because:
select id, date(check_in), date(checkout) from rezervare ;
+----+----------------+----------------+
| id | date(check_in) | date(checkout) |
+----+----------------+----------------+
| 1 | NULL | NULL |
| 2 | NULL | NULL |
| 3 | NULL | NULL |
| 4 | NULL | NULL |
| 5 | NULL | NULL |
| 6 | NULL | NULL |
| 7 | NULL | NULL |
| 8 | NULL | NULL |
+----+----------------+----------------+
But you can use between, in my example it works fine:
select * from rezervare where checkout between '12-03-2015' and '15-03-2015';
+----+------------+------------+
| id | check_in | checkout |
+----+------------+------------+
| 1 | 12-03-2015 | 12-03-2015 |
| 2 | 13-03-2015 | 13-03-2015 |
| 3 | 14-03-2015 | 14-03-2015 |
| 4 | 15-03-2015 | 15-03-2015 |
+----+------------+------------+
select * from rezervare where checkout > '14-03-2015';
+----+------------+------------+
| id | check_in | checkout |
+----+------------+------------+
| 4 | 15-03-2015 | 15-03-2015 |
| 5 | 16-03-2015 | 16-03-2015 |
| 6 | 17-03-2015 | 17-03-2015 |
| 7 | 19-03-2015 | 19-03-2015 |
| 8 | 20-03-2015 | 20-03-2015 |
+----+------------+------------+
But true way - alter table and use correct date type.