Que tal tio gracias por los minutos al final la solucion era colocando el numero del campo en el ORDER BY
Código PHP:
SELECT D.CodProd, MAX(A.nomprod) AS ['PRODUCTO'], sum(D.cantidad) AS ['SUMA_CANTIDAD'], sum(D.precioventa) AS ['SUMA_PRECIO']
FROM DetalleFactura AS D INNER JOIN producto AS A ON A.Codprod=D.CodProd
GROUP BY D.Codprod
ORDER BY 3