Skip to main content

You may use following code

$collection=Mage::getResourceModel('catalog/product_collection') ->addAttributeToSelect('name') ->addAttributeToSelect('sku') ->addAttributeToSelect('special_price') ->addAttributeToSelect('price'); $collection->addAttributeToFilter('special_from_date',array(array('from' => Mage::getModel('core/date')->gmtDate()), array('special_from_date', 'null'=>true))); $collection->addAttributeToFilter('special_to_date',array(array('to' => Mage::getModel('core/date')->gmtDate()), array('special_to_date', 'null'=>true)));

$collection=Mage::getResourceModel('catalog/product_collection')
            ->addAttributeToSelect('name')
            ->addAttributeToSelect('sku')
            ->addAttributeToSelect('special_price')
            ->addAttributeToSelect('price');
$collection->addAttributeToFilter('special_from_date',array(array('from' => Mage::getModel('core/date')->gmtDate()),
                                 array('special_from_date', 'null'=>true)));
$collection->addAttributeToFilter('special_to_date',array(array('to' => Mage::getModel('core/date')->gmtDate()),
                                 array('special_to_date', 'null'=>true)));

You may use following code

$collection=Mage::getResourceModel('catalog/product_collection') ->addAttributeToSelect('name') ->addAttributeToSelect('sku') ->addAttributeToSelect('special_price') ->addAttributeToSelect('price'); $collection->addAttributeToFilter('special_from_date',array(array('from' => Mage::getModel('core/date')->gmtDate()), array('special_from_date', 'null'=>true))); $collection->addAttributeToFilter('special_to_date',array(array('to' => Mage::getModel('core/date')->gmtDate()), array('special_to_date', 'null'=>true)));

You may use following code

$collection=Mage::getResourceModel('catalog/product_collection')
            ->addAttributeToSelect('name')
            ->addAttributeToSelect('sku')
            ->addAttributeToSelect('special_price')
            ->addAttributeToSelect('price');
$collection->addAttributeToFilter('special_from_date',array(array('from' => Mage::getModel('core/date')->gmtDate()),
                                 array('special_from_date', 'null'=>true)));
$collection->addAttributeToFilter('special_to_date',array(array('to' => Mage::getModel('core/date')->gmtDate()),
                                 array('special_to_date', 'null'=>true)));
Source Link

You may use following code

$collection=Mage::getResourceModel('catalog/product_collection') ->addAttributeToSelect('name') ->addAttributeToSelect('sku') ->addAttributeToSelect('special_price') ->addAttributeToSelect('price'); $collection->addAttributeToFilter('special_from_date',array(array('from' => Mage::getModel('core/date')->gmtDate()), array('special_from_date', 'null'=>true))); $collection->addAttributeToFilter('special_to_date',array(array('to' => Mage::getModel('core/date')->gmtDate()), array('special_to_date', 'null'=>true)));