Active record order_by the result of multiplying two fields |
Thanks Bill. There seems to be a delay in my replies getting posted. I can't use just price min because the prices are in different currencies. 200,000 USD is more expensive than 50,000,000 Pesos. It's working now though... See me previous post above. Thanks for pointing me in the right direction though! Give my regards to Hillary
![]() (11-18-2014, 06:33 PM)bclinton Wrote:(11-18-2014, 05:22 PM)andycansdale Wrote: I like your idea of running the calculation in the select and then ordering on the new named field. It would be a nice clean way to do it. Perhaps you know how I could get this to work with select_min, which when translated into SQL already has the 'as [field_name]' included. This is the value that needs to be multiplied by the rate. |
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
|