Hi folks,
I am currently trying to use CActiveRecord->updateAll to update a calcuated field in a table.
The calculation will look at 'price1' and 'price2', then calculate the % difference between the two and enter the figure into 'percentage_change'.
I have done a thorough search for an answer to this but I cannot seem to find one. Can anyone help?
Also, is the calculation can be done by referencing a custom function which does the calculation rather than using SQL syntax?
Any help would be greatly appreciated!
I am currently trying to use CActiveRecord->updateAll to update a calcuated field in a table.
The calculation will look at 'price1' and 'price2', then calculate the % difference between the two and enter the figure into 'percentage_change'.
I have done a thorough search for an answer to this but I cannot seem to find one. Can anyone help?
Also, is the calculation can be done by referencing a custom function which does the calculation rather than using SQL syntax?
Any help would be greatly appreciated!