When I was using PHP and MySQL I could do the following order by statement...
select * from database order by field1/field2 desc
when I try this using MSSQL it won't divide field1 by field2.
Is there a different way to do this using MSSQL
Thanks
I don't use MSSQL server much, but maybe enclosing the fields in parens would help?
select * from table order by (field1/field2) desc
???
select *, (field1/field2) as f12div from database order by f12div desc
I can get it to divide the number now... but when that number is less than 1 such as .678 it is coming up as 0.
You'll probably have to cast that field as a decimal or something. I can't remember if/how it's possible with mysql.