usa concat()

.....
where concat(anno,'-',mese,'-',giorno) between '$data1' AND '$data2'