1
I’m doing a query and I’m transforming the data no formato
and then I want to use the data_vencimento
original in order by
but it doesn’t 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 doesn’t work, I’m doing a variable data_vencimento
with the same field name but I need to do this to avoid complications in jquery.
What I ask you to help me with is how to do when I give the ORDER BY data_vencimento ASC
it use the original field value instead of the formatted date(string).
Yeah buddy that’s right worked out, Thanks.
– Silvio Andorinha