Welcome Guest, Not a member yet? Register   Sign In
Active record order_by the result of multiplying two fields
#4

UPDATE

This does not work but does partially order results

Code:
$this->db->order_by("project_units.price_min * rate", "asc");

This also does not work but does partially order results (removed computed field but same outcome)

Code:
$this->db->order_by("project_units.price_min", "asc");

This does work (removed reference to the table)

Code:
$this->db->order_by("price_min", "asc");

At least now I know where the problem was with the semi-sorted results. I still need to resolve the other problem which is that i must oder the results by a computed value - Price * Exchange rate.

Any ideas? Cheers!
Reply


Messages In This Thread
RE: Active record order_by the result of multiplying two fields - by andycansdale - 11-18-2014, 04:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB