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

Hi,

Thanks for your reply. I'm not using version 3.0 yet. Also, the sort value has to be computed otherwise we won't be able to sort projects in multiple currencies. Eg:

From price in first project is 300,000,000 pesos. From price in second project is 400,000 US Dollars. The first project in pesos has lower entry level pricing, but would appear after the project with a base currency of Dollars if we only work on the field without first multiplying it by its exchange rate.

(11-18-2014, 04:38 PM)twpmarketing Wrote: From the 3.0 User Guide
"Lets you set an ORDER BY clause.

The first parameter contains the name of the column you would like to order by.
The second parameter lets you set the direction of the result. Options are ASC, DESC AND RANDOM."


Use the field name itself, not the computed value.
Reply


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



Theme © iAndrew 2016 - Forum software by © MyBB