I'm doing a query and I'm transforming the data no formato
brazilian and then I want to use the data_vencimento
original in order by
but it does not work
code:
SELECT *,DATE_FORMAT(data_vencimento,'%d/%m/%Y') as data_vencimento, DATE_FORMAT(data_pagamento,'%d/%m/%Y') as data_pagamento FROM cta_pagar WHERE id_nota='$nota' AND id_fornecedor='$fornecedor' ORDER BY data_vencimento ASC
I know why it does not work, I'm making a data_vencimento
variable with the same field name but I need to do this to avoid complications in jquery.
What I ask you to help me is how to do when I give ORDER BY data_vencimento ASC
it uses the original value of the field instead of the formatted date (string).