There has been an error processing your request

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') WHERE (IF(at_status.value_id > 0, at_status.value, at_status_default.value) = ' at line 4, query was: SELECT DISTINCT COUNT(DISTINCT e.entity_id) FROM `catalog_product_entity` AS `e`
 INNER JOIN `catalog_product_entity_int` AS `at_status_default` ON (`at_status_default`.`entity_id` = `e`.`entity_id`) AND (`at_status_default`.`attribute_id` = '96') AND `at_status_default`.`store_id` = 0
 LEFT JOIN `catalog_product_entity_int` AS `at_status` ON (`at_status`.`entity_id` = `e`.`entity_id`) AND (`at_status`.`attribute_id` = '96') AND (`at_status`.`store_id` = 1)
 INNER JOIN `catalog_category_product` AS `at_category_id` ON (at_category_id.`product_id`=e.entity_id) AND () WHERE (IF(at_status.value_id > 0, at_status.value, at_status_default.value) = 1)
Trace: #0 /var/www/html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array) #1 /var/www/html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array) #2 /var/www/html/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array) #3 /var/www/html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT DISTINCT...', Array) #4 /var/www/html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SELECT DISTINCT...', Array) #5 /var/www/html/lib/Zend/Db/Adapter/Abstract.php(828): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array) #6 /var/www/html/lib/Varien/Data/Collection/Db.php(225): Zend_Db_Adapter_Abstract->fetchOne(Object(Varien_Db_Select), Array) #7 /var/www/html/app/code/core/Mage/Catalog/Block/Product/List.php(568): Varien_Data_Collection_Db->getSize() #8 /var/www/html/app/design/frontend/smartwave/granada/template/catalog/product/list.phtml(69): Mage_Catalog_Block_Product_List->getProductsByCategoryIds(Array, NULL, NULL) #9 /var/www/html/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/html/a...') #10 /var/www/html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/smartw...') #11 /var/www/html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView() #12 /var/www/html/app/code/core/Mage/Core/Block/Abstract.php(923): Mage_Core_Block_Template->_toHtml() #13 /var/www/html/app/code/core/Mage/Core/Block/Abstract.php(641): Mage_Core_Block_Abstract->toHtml() #14 /var/www/html/app/code/core/Mage/Core/Block/Abstract.php(585): Mage_Core_Block_Abstract->_getChildHtml('product_list', true) #15 /var/www/html/app/code/core/Mage/Catalog/Block/Category/View.php(90): Mage_Core_Block_Abstract->getChildHtml('product_list') #16 /var/www/html/app/design/frontend/smartwave/granada/template/catalog/category/view.phtml(87): Mage_Catalog_Block_Category_View->getProductListHtml() #17 /var/www/html/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/html/a...') #18 /var/www/html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/smartw...') #19 /var/www/html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView() #20 /var/www/html/app/code/core/Mage/Core/Block/Abstract.php(923): Mage_Core_Block_Template->_toHtml() #21 /var/www/html/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml() #22 /var/www/html/app/code/core/Mage/Core/Block/Abstract.php(923): Mage_Core_Block_Text_List->_toHtml() #23 /var/www/html/app/code/core/Mage/Core/Block/Abstract.php(641): Mage_Core_Block_Abstract->toHtml() #24 /var/www/html/app/code/core/Mage/Core/Block/Abstract.php(585): Mage_Core_Block_Abstract->_getChildHtml('content', true) #25 /var/www/html/app/design/frontend/smartwave/granada/template/page/2columns-left.phtml(60): Mage_Core_Block_Abstract->getChildHtml('content') #26 /var/www/html/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/html/a...') #27 /var/www/html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/smartw...') #28 /var/www/html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView() #29 /var/www/html/app/code/core/Mage/Core/Block/Abstract.php(923): Mage_Core_Block_Template->_toHtml() #30 /var/www/html/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml() #31 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput() #32 /var/www/html/app/code/local/Smartwave/Ajaxcatalog/controllers/Catalog/CategoryController.php(122): Mage_Core_Controller_Varien_Action->renderLayout() #33 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Smartwave_Ajaxcatalog_Catalog_CategoryController->viewAction() #34 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('view') #35 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http)) #36 /var/www/html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch() #37 /var/www/html/app/Mage.php(685): Mage_Core_Model_App->run(Array) #38 /var/www/html/index.php(135): Mage::run('', 'store') #39 {main}

Error log record number: 414216539133