select distinct b.execution_date,b.topik,m.name as id_media_seller,a.name as id_advertiser,p.name as id_product_category,bt.name as group_id,b.price
from tbl_batch b,tbl_media_seller m,tbl_advertiser a,tbl_product_category p,tbl_bts_group bt
where m.id=b.id_media_seller and a.id=b.id_advertiser and p.id=b.id_product_category and bt.id=group_id and (b.execution_date >= '2011-07-05' and b.execution_date <= '2012-08-30')
and i want to convert into cdbcriteria like this but it’s not working :
thanks hermans, thanks all for all your help, it solve now.
here the codes(hope it will help people who has the same problem):
$criteria->select='execution_date,topik,m.name as id_media_seller,a.name as id_advertiser,p.name as id_product_category,bt.name as group_id,price';
$criteria->join='JOIN tbl_bts_group bt ON t.group_id = bt.id';
$criteria->join.=' JOIN tbl_media_seller m ON t.id_media_seller = m.id';
$criteria->join.=' JOIN tbl_advertiser a ON t.id_advertiser = a.id';
$criteria->join.=' JOIN tbl_product_category p ON t.id_product_category = p.id';
$criteria->addCondition('m.id=t.id_media_seller and a.id=t.id_advertiser and p.id=t.id_product_category and bt.id=t.group_id');
$criteria->addCondition('execution_date >= :to AND execution_date <= :from');