Relations Stat Can Add Condition ?


Follow this tutorial statistical-query

class Post extends CActiveRecord


    public function relations()


        return array(

            'commentCount'=>array(self::STAT, 'Comment', 'post_id'),


                self::STAT, 'Category', 'post_category(post_id, category_id)'





Assuming table Comment have column created_date

In some case i want statistic some Comment have created_date from date to date.

So in my Criteria:


but i get this error 1054 Unknown column commentCount.created_date.

Can i add condition with relation STAT like relation HAS_MANY. Thanks