Active record order_by the result of multiplying two fields |
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! |
Messages In This Thread |
Active record order_by the result of multiplying two fields - by andycansdale - 11-18-2014, 04:24 PM
RE: Active record order_by the result of multiplying two fields - by twpmarketing - 11-18-2014, 04:38 PM
RE: Active record order_by the result of multiplying two fields - by andycansdale - 11-18-2014, 04:45 PM
RE: Active record order_by the result of multiplying two fields - by andycansdale - 11-18-2014, 04:54 PM
RE: Active record order_by the result of multiplying two fields - by bclinton - 11-18-2014, 05:13 PM
RE: Active record order_by the result of multiplying two fields - by andycansdale - 11-18-2014, 05:22 PM
RE: Active record order_by the result of multiplying two fields - by andycansdale - 11-18-2014, 06:28 PM
RE: Active record order_by the result of multiplying two fields - by bclinton - 11-18-2014, 06:33 PM
RE: Active record order_by the result of multiplying two fields - by andycansdale - 11-18-2014, 06:39 PM
|