DATE_FORMAT function - Mysql

0

I have this query below, which brings all the information I need. However the resolution field is with the date (yy-mm-dd), I need it to return with the date formed as dd / mm / yy:

select * 
FROM denuncia 
WHERE resolution BETWEEN ('2018-01-01') AND ('2018-12-31') 
ORDER BY resolution ASC;

With this query, bring the formatted date:

select resolution, DATE_FORMAT( 'resolution' , '%d/%c/%Y' ) AS 'resolution' 
FROM denuncia;

I can not join these two queries to make the first select and bring the formatted dates accordingly.

    
asked by anonymous 20.02.2018 / 15:52

1 answer

0

You can specify the fields you want to bring from the table:

select id, DATE_FORMAT( 'resolution' , '%d/%c/%Y' ) AS 'resolution'/*, demais_campos*/
FROM denuncia 
WHERE resolution BETWEEN ('2018-01-01') AND ('2018-12-31') 
ORDER BY resolution ASC;
    
20.02.2018 / 15:55