I’m attempting to get all order items from the last 24 hours. I have the query locked down, so it’s giving me back what I need (an order_id, and created_on value).
$order_items = Mage::getResourceModel('sales/order_item_collection')
->addAttributeToSelect('order_id')
->addAttributeToSelect('created_at')
->addFieldToFilter('sku', $membership_sku)
->toArray();
I’ve searched all over, and it looks like I need to add another ->addFieldToFilter() property, but I’m not quite sure how it should be structured. Any examples would be extremely helpful.
If it helps, I’m using Magento Enterprise v1.12.0.2
I think you will need to reformat your times to be able to get good results: