Search between date using two columns [duplicate]

-3

What's wrong?

SELECT
    ID_Contrato_Reserva,
    DATE_FORMAT(STR_TO_DATE(data_ini,"%d/%m/%Y" ), "%Y/%m/%d") AS dataIni,
    DATE_FORMAT(STR_TO_DATE(data_Fim,"%d/%m/%Y" ), "%Y/%m/%d") AS dataFim
FROM 
    contrato_reserva

WHERE
    ( dataIni BETWEEN "2011/09/14" AND "2012/09/14" )
    AND
    ( dataFim BETWEEN "2011/09/17" AND "2012/09/17" )

Online link

    
asked by anonymous 20.04.2014 / 19:46

1 answer

0
SELECT ID_Contrato_Reserva, DATE_FORMAT(STR_TO_DATE(data_ini,"%d/%m/%Y" ), "%Y/%m/%d") AS dataIni, DATE_FORMAT(STR_TO_DATE(data_Fim,"%d/%m/%Y" ), "%Y/%m/%d") AS dataFim 
FROM contrato_reserva 
WHERE ( dataIni BETWEEN "2011/09/14" AND "2012/09/17" ) 
AND ( dataFim BETWEEN "2011/09/14" AND "2012/09/17" )
    
20.04.2014 / 20:15