[Skip to main content](#vessel-content)

#   Customer Report Returns SQL Error

##

- **[artisanwebandprint](/forum/user/6555-artisanwebandprint "View artisanwebandprint's Profile")**
- [![artisanwebandprint's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6555-artisanwebandprint "View artisanwebandprint's Profile") Topic Author
- [ Offline](/forum/user/6555-artisanwebandprint)

Less More

- Posts: 158
- Thank you received: 6
-
-

10 years 4 months ago -  10 years 4 months ago [\#244111](#244111) by [artisanwebandprint](/forum/user/6555-artisanwebandprint "View artisanwebandprint's Profile")  *[Customer Report Returns SQL Error](/forum/36-reports-statistics/885287-customer-report-returns-sql-error#244111 "-- url of the page with the problem -- :   offeringsjewelry.com  -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.8 -- PHP version -- : 5.4 -- Browser(s) name and version -- : All -- Error-message(debug-mod must be tuned on) -- : 1054 Unknown column 'cat.category&#95;id' in 'where clause' SQL=SELECT &#42;, SUM( case when o.order&#95;currency&#95;id = '2' then o.order&#95;full&#95;price end ) AS Total, COUNT(o.order&#95;id) AS order&#95;number FROM #&#95;&#95;hikashop&#95;order as o LEFT JOIN #&#95;&#95;hikashop&#95;user as a ON o.order&#95;user&#95;id=a.user&#95;id LEFT JOIN #&#95;&#95;users as u ON u.id=a.user&#95;cms&#95;id WHERE a.user&#95;partner&#95;activated=0 AND cat.category&#95;id IN ('0','2','34','88','35','13','15','16','17','18','23','24','25','26','27','28','30','31','32','85','33','36','37','38') AND a.user&#95;created &gt; 1435509022 AND a.user&#95;created  Hello,  I am trying to create a report that lists the best customers by total Sales.  Here's the screenshot of my configuration:  Here's the error I get: 1054 Unknown column 'cat.category&#95;id' in 'where clause' SQL=SELECT &#42;, SUM( case when o.order&#95;currency&#95;id = '2' then o.order&#95;full&#95;price end ) AS Total, COUNT(o.order&#95;id) AS order&#95;number FROM #&#95;&#95;hikashop&#95;order as o LEFT JOIN #&#95;&#95;hikashop&#95;user as a ON o.order&#95;user&#95;id=a.user&#95;id LEFT JOIN #&#95;&#95;users as u ON u.id=a.user&#95;cms&#95;id WHERE a.user&#95;partner&#95;activated=0 AND cat.category&#95;id IN ('0','2','34','88','35','13','15','16','17','18','23','24','25','26','27','28','30','31','32','85','33','36','37','38') AND a.user&#95;created &gt; 1435509022 AND a.user&#95;created ")* was created by *[artisanwebandprint](/forum/user/6555-artisanwebandprint "View artisanwebandprint's Profile")*

-- url of the page with the problem -- : [ offeringsjewelry.com](https://offeringsjewelry.com)
-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.5.8
-- PHP version -- : 5.4
-- Browser(s) name and version -- : All
-- Error-message(debug-mod must be tuned on) -- : 1054 Unknown column 'cat.category_id' in 'where clause' SQL=SELECT *, SUM( case when o.order_currency_id = '2' then o.order_full_price end ) AS Total, COUNT(o.order_id) AS order_number FROM #__hikashop_order as o LEFT JOIN #__hikashop_user as a ON o.order_user_id=a.user_id LEFT JOIN #__users as u ON u.id=a.user_cms_id WHERE a.user_partner_activated=0 AND cat.category_id IN ('0','2','34','88','35','13','15','16','17','18','23','24','25','26','27','28','30','31','32','85','33','36','37','38') AND a.user_created &gt; 1435509022 AND a.user_created

Hello,

I am trying to create a report that lists the best customers by total Sales.

**Here's the screenshot of my configuration:**
[ ![&#91;img](http://content.screencast.com/users/MyArtisanWeb/folders/Snagit/media/af7e17b8-1819-4fea-8b3e-884cae9eaf3d/06.27.2016-12.35.png) ](http://content.screencast.com/users/MyArtisanWeb/folders/Snagit/media/af7e17b8-1819-4fea-8b3e-884cae9eaf3d/06.27.2016-12.35.png "&#91;img")

**Here's the error I get:**
1054 Unknown column 'cat.category_id' in 'where clause' SQL=SELECT *, SUM( case when o.order_currency_id = '2' then o.order_full_price end ) AS Total, COUNT(o.order_id) AS order_number FROM #__hikashop_order as o LEFT JOIN #__hikashop_user as a ON o.order_user_id=a.user_id LEFT JOIN #__users as u ON u.id=a.user_cms_id WHERE a.user_partner_activated=0 AND cat.category_id IN ('0','2','34','88','35','13','15','16','17','18','23','24','25','26','27','28','30','31','32','85','33','36','37','38') AND a.user_created &gt; 1435509022 AND a.user_created &lt; 1467045022 AND a.user_id IS NOT NULL AND o.order_type='sale' GROUP BY a.user_id ORDER BY Total DESC LIMIT 20

Thanks,

Dawn

Last edit: 10 years 4 months ago by [artisanwebandprint](/forum/user/6555-artisanwebandprint "View artisanwebandprint's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODUyODctY3VzdG9tZXItcmVwb3J0LXJldHVybnMtc3FsLWVycm9yP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

10 years 4 months ago [\#244121](#244121) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Customer Report Returns SQL Error](/forum/36-reports-statistics/885287-customer-report-returns-sql-error#244121 "-- url of the page with the problem -- :   offeringsjewelry.com  -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.8 -- PHP version -- : 5.4 -- Browser(s) name and version -- : All -- Error-message(debug-mod must be tuned on) -- : 1054 Unknown column 'cat.category&#95;id' in 'where clause' SQL=SELECT &#42;, SUM( case when o.order&#95;currency&#95;id = '2' then o.order&#95;full&#95;price end ) AS Total, COUNT(o.order&#95;id) AS order&#95;number FROM #&#95;&#95;hikashop&#95;order as o LEFT JOIN #&#95;&#95;hikashop&#95;user as a ON o.order&#95;user&#95;id=a.user&#95;id LEFT JOIN #&#95;&#95;users as u ON u.id=a.user&#95;cms&#95;id WHERE a.user&#95;partner&#95;activated=0 AND cat.category&#95;id IN ('0','2','34','88','35','13','15','16','17','18','23','24','25','26','27','28','30','31','32','85','33','36','37','38') AND a.user&#95;created &gt; 1435509022 AND a.user&#95;created  Hello,  I am trying to create a report that lists the best customers by total Sales.  Here's the screenshot of my configuration:  Here's the error I get: 1054 Unknown column 'cat.category&#95;id' in 'where clause' SQL=SELECT &#42;, SUM( case when o.order&#95;currency&#95;id = '2' then o.order&#95;full&#95;price end ) AS Total, COUNT(o.order&#95;id) AS order&#95;number FROM #&#95;&#95;hikashop&#95;order as o LEFT JOIN #&#95;&#95;hikashop&#95;user as a ON o.order&#95;user&#95;id=a.user&#95;id LEFT JOIN #&#95;&#95;users as u ON u.id=a.user&#95;cms&#95;id WHERE a.user&#95;partner&#95;activated=0 AND cat.category&#95;id IN ('0','2','34','88','35','13','15','16','17','18','23','24','25','26','27','28','30','31','32','85','33','36','37','38') AND a.user&#95;created &gt; 1435509022 AND a.user&#95;created ")*

Hi,

Thank you for your feedback. I've added a few patches on our end so that it works properly.
Download again the install package on our website and install it on yours and that should fix the problem.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODUyODctY3VzdG9tZXItcmVwb3J0LXJldHVybnMtc3FsLWVycm9yP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[artisanwebandprint](/forum/user/6555-artisanwebandprint "View artisanwebandprint's Profile")**
- [![artisanwebandprint's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6555-artisanwebandprint "View artisanwebandprint's Profile") Topic Author
- [ Offline](/forum/user/6555-artisanwebandprint)

Less More

- Posts: 158
- Thank you received: 6
-
-

10 years 4 months ago -  10 years 4 months ago [\#244221](#244221) by [artisanwebandprint](/forum/user/6555-artisanwebandprint "View artisanwebandprint's Profile")  Replied by *[artisanwebandprint](/forum/user/6555-artisanwebandprint "View artisanwebandprint's Profile")* on topic *[Customer Report Returns SQL Error](/forum/36-reports-statistics/885287-customer-report-returns-sql-error#244221 "-- url of the page with the problem -- :   offeringsjewelry.com  -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.8 -- PHP version -- : 5.4 -- Browser(s) name and version -- : All -- Error-message(debug-mod must be tuned on) -- : 1054 Unknown column 'cat.category&#95;id' in 'where clause' SQL=SELECT &#42;, SUM( case when o.order&#95;currency&#95;id = '2' then o.order&#95;full&#95;price end ) AS Total, COUNT(o.order&#95;id) AS order&#95;number FROM #&#95;&#95;hikashop&#95;order as o LEFT JOIN #&#95;&#95;hikashop&#95;user as a ON o.order&#95;user&#95;id=a.user&#95;id LEFT JOIN #&#95;&#95;users as u ON u.id=a.user&#95;cms&#95;id WHERE a.user&#95;partner&#95;activated=0 AND cat.category&#95;id IN ('0','2','34','88','35','13','15','16','17','18','23','24','25','26','27','28','30','31','32','85','33','36','37','38') AND a.user&#95;created &gt; 1435509022 AND a.user&#95;created  Hello,  I am trying to create a report that lists the best customers by total Sales.  Here's the screenshot of my configuration:  Here's the error I get: 1054 Unknown column 'cat.category&#95;id' in 'where clause' SQL=SELECT &#42;, SUM( case when o.order&#95;currency&#95;id = '2' then o.order&#95;full&#95;price end ) AS Total, COUNT(o.order&#95;id) AS order&#95;number FROM #&#95;&#95;hikashop&#95;order as o LEFT JOIN #&#95;&#95;hikashop&#95;user as a ON o.order&#95;user&#95;id=a.user&#95;id LEFT JOIN #&#95;&#95;users as u ON u.id=a.user&#95;cms&#95;id WHERE a.user&#95;partner&#95;activated=0 AND cat.category&#95;id IN ('0','2','34','88','35','13','15','16','17','18','23','24','25','26','27','28','30','31','32','85','33','36','37','38') AND a.user&#95;created &gt; 1435509022 AND a.user&#95;created ")*

Hello Nicolas,

I reinstalled the package as you suggested. I am now getting a different error when I try to run a report using the same settings.

**Here's the error**
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 '+' at line 1 SQL=SELECT *, SUM( case when o.order_currency_id = '2' then o.order_full_price end ) AS Total, COUNT(o.order_id) AS order_number FROM #__hikashop_order as o LEFT JOIN #__hikashop_user as a ON o.order_user_id=a.user_id LEFT JOIN #__users as u ON u.id=a.user_cms_id LEFT JOIN #__hikashop_order_product AS prod ON prod.order_id = o.order_id LEFT JOIN #__hikashop_product AS p ON prod.product_id = p.product_id LEFT JOIN #__hikashop_product_category AS cat ON cat.product_id = p.product_id OR cat.product_id=p.product_parent_id LEFT JOIN #__hikashop_category AS categ ON cat.category_id = categ.category_id LEFT JOIN #__users AS b ON a.user_cms_id=b.id WHERE a.user_partner_activated=0 AND cat.category_id IN ('0','2','34','88','35','13','15','16','17','18','23','24','25','26','27','28','30','31','32','85','33','36','37','38') AND a.user_id IS NOT NULL AND o.order_type='sale' GROUP BY a.user_id ORDER BY Total DESC LIMIT 20+

Last edit: 10 years 4 months ago by [artisanwebandprint](/forum/user/6555-artisanwebandprint "View artisanwebandprint's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODUyODctY3VzdG9tZXItcmVwb3J0LXJldHVybnMtc3FsLWVycm9yP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4080
-
- [](http://obsi.dev)
-

10 years 4 months ago [\#244224](#244224) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Customer Report Returns SQL Error](/forum/36-reports-statistics/885287-customer-report-returns-sql-error#244224 "-- url of the page with the problem -- :   offeringsjewelry.com  -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.8 -- PHP version -- : 5.4 -- Browser(s) name and version -- : All -- Error-message(debug-mod must be tuned on) -- : 1054 Unknown column 'cat.category&#95;id' in 'where clause' SQL=SELECT &#42;, SUM( case when o.order&#95;currency&#95;id = '2' then o.order&#95;full&#95;price end ) AS Total, COUNT(o.order&#95;id) AS order&#95;number FROM #&#95;&#95;hikashop&#95;order as o LEFT JOIN #&#95;&#95;hikashop&#95;user as a ON o.order&#95;user&#95;id=a.user&#95;id LEFT JOIN #&#95;&#95;users as u ON u.id=a.user&#95;cms&#95;id WHERE a.user&#95;partner&#95;activated=0 AND cat.category&#95;id IN ('0','2','34','88','35','13','15','16','17','18','23','24','25','26','27','28','30','31','32','85','33','36','37','38') AND a.user&#95;created &gt; 1435509022 AND a.user&#95;created  Hello,  I am trying to create a report that lists the best customers by total Sales.  Here's the screenshot of my configuration:  Here's the error I get: 1054 Unknown column 'cat.category&#95;id' in 'where clause' SQL=SELECT &#42;, SUM( case when o.order&#95;currency&#95;id = '2' then o.order&#95;full&#95;price end ) AS Total, COUNT(o.order&#95;id) AS order&#95;number FROM #&#95;&#95;hikashop&#95;order as o LEFT JOIN #&#95;&#95;hikashop&#95;user as a ON o.order&#95;user&#95;id=a.user&#95;id LEFT JOIN #&#95;&#95;users as u ON u.id=a.user&#95;cms&#95;id WHERE a.user&#95;partner&#95;activated=0 AND cat.category&#95;id IN ('0','2','34','88','35','13','15','16','17','18','23','24','25','26','27','28','30','31','32','85','33','36','37','38') AND a.user&#95;created &gt; 1435509022 AND a.user&#95;created ")*

Hi,

Please replace your "20+" value in the report configuration in order to put just a number (20).
I'll add some patchs in HikaShop in order to avoid such kind of issue in the future.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODUyODctY3VzdG9tZXItcmVwb3J0LXJldHVybnMtc3FsLWVycm9yP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[artisanwebandprint](/forum/user/6555-artisanwebandprint "View artisanwebandprint's Profile")**
- [![artisanwebandprint's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6555-artisanwebandprint "View artisanwebandprint's Profile") Topic Author
- [ Offline](/forum/user/6555-artisanwebandprint)

Less More

- Posts: 158
- Thank you received: 6
-
-

10 years 4 months ago [\#244369](#244369) by [artisanwebandprint](/forum/user/6555-artisanwebandprint "View artisanwebandprint's Profile")  Replied by *[artisanwebandprint](/forum/user/6555-artisanwebandprint "View artisanwebandprint's Profile")* on topic *[Customer Report Returns SQL Error](/forum/36-reports-statistics/885287-customer-report-returns-sql-error#244369 "-- url of the page with the problem -- :   offeringsjewelry.com  -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.8 -- PHP version -- : 5.4 -- Browser(s) name and version -- : All -- Error-message(debug-mod must be tuned on) -- : 1054 Unknown column 'cat.category&#95;id' in 'where clause' SQL=SELECT &#42;, SUM( case when o.order&#95;currency&#95;id = '2' then o.order&#95;full&#95;price end ) AS Total, COUNT(o.order&#95;id) AS order&#95;number FROM #&#95;&#95;hikashop&#95;order as o LEFT JOIN #&#95;&#95;hikashop&#95;user as a ON o.order&#95;user&#95;id=a.user&#95;id LEFT JOIN #&#95;&#95;users as u ON u.id=a.user&#95;cms&#95;id WHERE a.user&#95;partner&#95;activated=0 AND cat.category&#95;id IN ('0','2','34','88','35','13','15','16','17','18','23','24','25','26','27','28','30','31','32','85','33','36','37','38') AND a.user&#95;created &gt; 1435509022 AND a.user&#95;created  Hello,  I am trying to create a report that lists the best customers by total Sales.  Here's the screenshot of my configuration:  Here's the error I get: 1054 Unknown column 'cat.category&#95;id' in 'where clause' SQL=SELECT &#42;, SUM( case when o.order&#95;currency&#95;id = '2' then o.order&#95;full&#95;price end ) AS Total, COUNT(o.order&#95;id) AS order&#95;number FROM #&#95;&#95;hikashop&#95;order as o LEFT JOIN #&#95;&#95;hikashop&#95;user as a ON o.order&#95;user&#95;id=a.user&#95;id LEFT JOIN #&#95;&#95;users as u ON u.id=a.user&#95;cms&#95;id WHERE a.user&#95;partner&#95;activated=0 AND cat.category&#95;id IN ('0','2','34','88','35','13','15','16','17','18','23','24','25','26','27','28','30','31','32','85','33','36','37','38') AND a.user&#95;created &gt; 1435509022 AND a.user&#95;created ")*

Hello,

Thank you for the instruction on removing the + sign. We can now generate a report. The information in the report is very dense however. Is there a way to simplify the results to only display certain information about the customers? Attached is the exported CSV. And here is a screenshot of the exported CSV: [ screencast.com/t/dMpcuQFeD7G](http://screencast.com/t/dMpcuQFeD7G)

Is this normal? We would like to only export the information that appears in the report within Hikashop (Name, username, email, etc).

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODUyODctY3VzdG9tZXItcmVwb3J0LXJldHVybnMtc3FsLWVycm9yP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

10 years 4 months ago [\#244385](#244385) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Customer Report Returns SQL Error](/forum/36-reports-statistics/885287-customer-report-returns-sql-error#244385 "-- url of the page with the problem -- :   offeringsjewelry.com  -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.8 -- PHP version -- : 5.4 -- Browser(s) name and version -- : All -- Error-message(debug-mod must be tuned on) -- : 1054 Unknown column 'cat.category&#95;id' in 'where clause' SQL=SELECT &#42;, SUM( case when o.order&#95;currency&#95;id = '2' then o.order&#95;full&#95;price end ) AS Total, COUNT(o.order&#95;id) AS order&#95;number FROM #&#95;&#95;hikashop&#95;order as o LEFT JOIN #&#95;&#95;hikashop&#95;user as a ON o.order&#95;user&#95;id=a.user&#95;id LEFT JOIN #&#95;&#95;users as u ON u.id=a.user&#95;cms&#95;id WHERE a.user&#95;partner&#95;activated=0 AND cat.category&#95;id IN ('0','2','34','88','35','13','15','16','17','18','23','24','25','26','27','28','30','31','32','85','33','36','37','38') AND a.user&#95;created &gt; 1435509022 AND a.user&#95;created  Hello,  I am trying to create a report that lists the best customers by total Sales.  Here's the screenshot of my configuration:  Here's the error I get: 1054 Unknown column 'cat.category&#95;id' in 'where clause' SQL=SELECT &#42;, SUM( case when o.order&#95;currency&#95;id = '2' then o.order&#95;full&#95;price end ) AS Total, COUNT(o.order&#95;id) AS order&#95;number FROM #&#95;&#95;hikashop&#95;order as o LEFT JOIN #&#95;&#95;hikashop&#95;user as a ON o.order&#95;user&#95;id=a.user&#95;id LEFT JOIN #&#95;&#95;users as u ON u.id=a.user&#95;cms&#95;id WHERE a.user&#95;partner&#95;activated=0 AND cat.category&#95;id IN ('0','2','34','88','35','13','15','16','17','18','23','24','25','26','27','28','30','31','32','85','33','36','37','38') AND a.user&#95;created &gt; 1435509022 AND a.user&#95;created ")*

Hi,

The problem is that you're opening your CSV with Excel without telling it which separator to use. By default it uses , with your version. But the CSV uses ; by default in HikaShop.
There is a setting in the HikaShop configuration to change the CSV separator for the generated CSVs, and likewise, there is a setting in your Excel to select the separator to use for reading the CSV:
[ superuser.com/questions/396469/how-to-co...port-into-excel-2010](http://superuser.com/questions/396469/how-to-control-csv-import-into-excel-2010)
Then, you'll be able to easily delete the columns you don't need in your CSV and navigate through it.
There is no setting in HikaShop to configure how reports export the data they generate.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODUyODctY3VzdG9tZXItcmVwb3J0LXJldHVybnMtc3FsLWVycm9yP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[artisanwebandprint](/forum/user/6555-artisanwebandprint "View artisanwebandprint's Profile")**
- [![artisanwebandprint's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6555-artisanwebandprint "View artisanwebandprint's Profile") Topic Author
- [ Offline](/forum/user/6555-artisanwebandprint)

Less More

- Posts: 158
- Thank you received: 6
-
-

10 years 4 months ago [\#244481](#244481) by [artisanwebandprint](/forum/user/6555-artisanwebandprint "View artisanwebandprint's Profile")  Replied by *[artisanwebandprint](/forum/user/6555-artisanwebandprint "View artisanwebandprint's Profile")* on topic *[Customer Report Returns SQL Error](/forum/36-reports-statistics/885287-customer-report-returns-sql-error#244481 "-- url of the page with the problem -- :   offeringsjewelry.com  -- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.5.8 -- PHP version -- : 5.4 -- Browser(s) name and version -- : All -- Error-message(debug-mod must be tuned on) -- : 1054 Unknown column 'cat.category&#95;id' in 'where clause' SQL=SELECT &#42;, SUM( case when o.order&#95;currency&#95;id = '2' then o.order&#95;full&#95;price end ) AS Total, COUNT(o.order&#95;id) AS order&#95;number FROM #&#95;&#95;hikashop&#95;order as o LEFT JOIN #&#95;&#95;hikashop&#95;user as a ON o.order&#95;user&#95;id=a.user&#95;id LEFT JOIN #&#95;&#95;users as u ON u.id=a.user&#95;cms&#95;id WHERE a.user&#95;partner&#95;activated=0 AND cat.category&#95;id IN ('0','2','34','88','35','13','15','16','17','18','23','24','25','26','27','28','30','31','32','85','33','36','37','38') AND a.user&#95;created &gt; 1435509022 AND a.user&#95;created  Hello,  I am trying to create a report that lists the best customers by total Sales.  Here's the screenshot of my configuration:  Here's the error I get: 1054 Unknown column 'cat.category&#95;id' in 'where clause' SQL=SELECT &#42;, SUM( case when o.order&#95;currency&#95;id = '2' then o.order&#95;full&#95;price end ) AS Total, COUNT(o.order&#95;id) AS order&#95;number FROM #&#95;&#95;hikashop&#95;order as o LEFT JOIN #&#95;&#95;hikashop&#95;user as a ON o.order&#95;user&#95;id=a.user&#95;id LEFT JOIN #&#95;&#95;users as u ON u.id=a.user&#95;cms&#95;id WHERE a.user&#95;partner&#95;activated=0 AND cat.category&#95;id IN ('0','2','34','88','35','13','15','16','17','18','23','24','25','26','27','28','30','31','32','85','33','36','37','38') AND a.user&#95;created &gt; 1435509022 AND a.user&#95;created ")*

Great! Thank you so much for all the help.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM2LXJlcG9ydHMtc3RhdGlzdGljcy84ODUyODctY3VzdG9tZXItcmVwb3J0LXJldHVybnMtc3FsLWVycm9yP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.074 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
