Magento Forum

How to get all Order since a particular date
 
nicolas46
Sr. Member
 
Total Posts:  210
Joined:  2008-04-09
Toulouse
 

When I do this :

$collectionCMD Mage::getResourceModel('sales/order_collection')        
                        ->
addAttributeToSelect('*')
                     ->
addAttributeToFilter(array(array('attribute' => 'created_at''datetime' => true'from' => $order_since)));
                    


                $collectionCMD
->printlogquery(true);
                 exit();
I get this sql query:
SELECT `e`.* FROM `mage_sales_order` AS `eWHERE (e.entity_type_id '11') AND ((e.created_at >= '2008-07-01 12:46:09'))

But I want this one ( “>=” ------> “>") :

SELECT `e`.* FROM `mage_sales_order` AS `eWHERE (e.entity_type_id '11') AND ((e.created_at >'2008-07-01 12:46:09'))

What I have to do please ?

[update]

I found :

$collectionCMD Mage::getResourceModel('sales/order_collection')        
                        ->
addAttributeToSelect('*')
                     ->
addAttributeToFilter(array(array('attribute' => 'created_at''datetime' => true'gt' => $order_since)));
                    
}
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top