How To Get Sum(Field) From Dataprovider?

here are my codes used to get SUM(field) ,but item from $dataProvider->getData() has no attribute ‘sold_sum’ ,How can I get ‘sold_sum’?Or I need to use Yii::app()->db->createCommand() instead?


	//$sql = "SELECT `name`,SUM({$field}) AS sold_sum,daily_sold_meanprice FROM `ne_zz` WHERE `stat_date` BETWEEN '{$startDate}' AND '{$endDate}' GROUP BY NAME ORDER BY sold_sum DESC";

	$criteria = new CDbCriteria();

	$criteria->select = "name,SUM({$field}) AS sold_sum,daily_sold_meanprice";

	$criteria->addBetweenCondition('stat_date', $startDate, $endDate);

	$criteria->group = 'name';

	$criteria->order = 'sold_sum';

	$criteria->limit = 5;


	$dataProvider = new CActiveDataProvider('Nezz', array(





	foreach($dataProvider->getData() as $item){

	    var_dump($item->sold_sum);//got nothing?!!!


Have you tried to add

public $sold_sum;

in Nezz model?