How to put a day, month and year placeholder in MySQL?

0

I need to add an invoice date column, which is organized by day month and year (dd / mm / yy). How do I leave this pre-set time format in MySQL Workbench?

    
asked by anonymous 21.10.2017 / 21:46

1 answer

1

If you store your dates with datetime or date there's no way, you have to deal with select . It's quite simple:

SELECT data, DATE_FORMAT(data,'%d/%m/%Y') as data_formatada
FROM tabela
ORDER BY data ASC

This script should select the date the way it is ( data ), the date in the format dd / mm / yyyy (% with%) and sort from oldest to new. To reverse sort, change data_formatada to ASC .

    
21.10.2017 / 22:26