mikell wrote:Format() returns a string...that's why its being ordered that way. If you want to
order it numerically then make sure the value you're ordering by is a number.
For example:
SELECT CAST(FORMAT(AVG(order.weights),2) AS decimal(9,2)) AS weight_avg FROM test ORDER BY weight_avg
Basically just make sure weight_avg is numeric.
Thanks, I tried this and am now receiving an error...
1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal(9,2)) AS weight_avg
I did notice this when I went searching: The DECIMAL type is available as of MySQL 5.0.8.
My host has 4.1.22 🙁
Any other way to convert?