I have a table with the structure below
Ineedtomakeaquerywithacertainintervalinordertogenerateareport.IusedtheBetween...commandandwithititreturnsthefollowingvalues
But for the interface I need to display the form dd-mm-yyyy and not as the saved bank which is yyyy-mm-dd.
I've already used the command
select * from venda where data_venda = DATE_FORMAT('18-01-2016', '%d-%m-%Y')
SELECT * FROM venda WHERE STR_TO_DATE(data_venda, '%d-%m-%Y') BETWEEN STR_TO_DATE('2016/01/18','%d-%m-%Y') AND STR_TO_DATE('2016/02/15','%d-%m-%Y')
But it always returns a null value.
Has anyone ever done this and could you help me?