0
votes

Hello can anyone please help me with the following error I'm getting within magento

There has been an error processing your request SQLSTATE[42S22]: Column not found: 1054 Unknown column 'SUM((IFNULL(main_table.base_total_invoiced, 0) - IFNULL(main_table.base_tax_invoiced, 0) - IFNULL(main_table.base_shipping_invoiced, 0) - (IFNULL(main_table.base_total_refunded, 0) - IFNULL(ma' in 'field list', query was: SELECT SUM((IFNULL(main_table.base_total_invoiced, 0) - IFNULL(main_table.base_tax_invoiced, 0) - IFNULL(main_table.base_shipping_invoiced, 0) - (IFNULL(main_table.base_total_refunded, 0) - IFNULL(main_table.base_tax_refunded, 0) - IFNULL(main_table.base_shipping_refunded, 0))) * main_table.base_to_global_rate) AS lifetime, AVG((IFNULL(main_table.base_total_invoiced, 0) - IFNULL(main_table.base_tax_invoiced, 0) - IFNULL(main_table.base_shipping_invoiced, 0) - (IFNULL(main_table.base_total_refunded, 0) - IFNULL(main_table.base_tax_refunded, 0) - IFNULL(main_table.base_shipping_refunded, 0))) * main_table.base_to_global_rate) AS average FROM sales_flat_order AS main_table WHERE (main_table.status NOT IN('canceled')) AND (main_table.state NOT IN('new', 'pending_payment'))

Trace:

# 0 /home/harrison/public_html/includes/src/Varien_Db_Statement_Pdo_Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/harrison/public_html/includes/src/__default.php(65540): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /home/harrison/public_html/includes/src/__default.php(54759): Zend_Db_Statement->execute(Array)
#3 /home/harrison/public_html/includes/src/__default.php(55796): Zend_Db_Adapter_Abstract->query('SELECT `SUM((IF...', Array)
#4 /home/harrison/public_html/includes/src/__default.php(56732): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `SUM((IF...', Array)
#5 /home/harrison/public_html/includes/src/__default.php(55016): Varien_Db_Adapter_Pdo_Mysql->query('SELECT `SUM((IF...', Array)
#6 /home/harrison/public_html/includes/src/__default.php(32374): Zend_Db_Adapter_Abstract->fetchAll('SELECT `SUM((IF...', Array)
#7 /home/harrison/public_html/includes/src/__default.php(33000): Varien_Data_Collection_Db->_fetchAll('SELECT `SUM((IF...', Array)
#8 /home/harrison/public_html/includes/src/__default.php(32206): Mage_Core_Model_Resource_Db_Collection_Abstract->getData()
#9 /home/harrison/public_html/includes/src/Mage_Adminhtml_Block_Dashboard_Sales.php(65): Varien_Data_Collection_Db->load()
#10 /home/harrison/public_html/includes/src/__default.php(1987): Mage_Adminhtml_Block_Dashboard_Sales->_prepareLayout()
#11 /home/harrison/public_html/includes/src/__default.php(28503): Mage_Core_Block_Abstract->setLayout(Object(Smartwave_All_Model_Core_Layout))
#12 /home/harrison/public_html/includes/src/Mage_Adminhtml_Block_Dashboard.php(54): Mage_Core_Model_Layout->createBlock('adminhtml/dashb...')
#13 /home/harrison/public_html/includes/src/__default.php(1987): Mage_Adminhtml_Block_Dashboard->_prepareLayout()
#14 /home/harrison/public_html/includes/src/__default.php(28503): Mage_Core_Block_Abstract->setLayout(Object(Smartwave_All_Model_Core_Layout))
#15 /home/harrison/public_html/includes/src/__default.php(28519): Mage_Core_Model_Layout->createBlock('adminhtml/dashb...', 'dashboard')
#16 /home/harrison/public_html/includes/src/__default.php(28286): Mage_Core_Model_Layout->addBlock('adminhtml/dashb...', 'dashboard')
#17 /home/harrison/public_html/includes/src/Smartwave_All_Model_Core_Layout.php(40): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#18 /home/harrison/public_html/includes/src/__default.php(28252): Smartwave_All_Model_Core_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#19 /home/harrison/public_html/includes/src/Smartwave_All_Model_Core_Layout.php(31): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#20 /home/harrison/public_html/includes/src/__default.php(28257): Smartwave_All_Model_Core_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#21 /home/harrison/public_html/includes/src/Smartwave_All_Model_Core_Layout.php(31): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#22 /home/harrison/public_html/includes/src/__default.php(14198): Smartwave_All_Model_Core_Layout->generateBlocks()
#23 /home/harrison/public_html/includes/src/__default.php(14123): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#24 /home/harrison/public_html/includes/src/Mage_Adminhtml_Controller_Action.php(275): Mage_Core_Controller_Varien_Action->loadLayout(NULL, true, true)
#25 /home/harrison/public_html/app/code/core/Mage/Adminhtml/controllers/DashboardController.php(40): Mage_Adminhtml_Controller_Action->loadLayout()
#26 /home/harrison/public_html/includes/src/__default.php(14272): Mage_Adminhtml_DashboardController->indexAction()
#27 /home/harrison/public_html/includes/src/__default.php(18736): Mage_Core_Controller_Varien_Action->dispatch('index')
#28 /home/harrison/public_html/includes/src/__default.php(18266): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#29 /home/harrison/public_html/includes/src/__default.php(21117): Mage_Core_Controller_Varien_Front->dispatch()
#30 /home/harrison/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#31 /home/harrison/public_html/index.php(83): Mage::run('base', 'website')
#32 {main}
2

2 Answers

0
votes

Try to disable compilation or recompile files.

0
votes

Fault was due to an incomplete upgrade. I had tried to upgrade to 1.9.2.2 but realised my skin didnt support it. So reuploaded the 1.9.2.1 files and all seemed to work. However during the 1.9.2.2 upgrade, it creates extra sql entries that the 1.9.2.1 files dont have associations for.

Fix is to fully upgrade to 1.9.2.2