Bom dia , é possível ordenar uma Query por um campo calculado ?
Ex.
Select campo1,campo2,(SELECT TOP 1 Status FROM Tbl_Andamento AS Andam WHERE Tbl_Pedidos.Ped_ID= Andam.Ped_ID order by Andam_ID desc) AS Status
From Tabela Order By Status
Obrigado
Ex.
Select campo1,campo2,(SELECT TOP 1 Status FROM Tbl_Andamento AS Andam WHERE Tbl_Pedidos.Ped_ID= Andam.Ped_ID order by Andam_ID desc) AS Status
From Tabela Order By Status
Obrigado