Export template error

Post Reply
rmcdonald
Investor
Investor
Posts: 417
Joined: 19 Dec 2018, 02:33
Name: Robert McDonald
Location: Auckland, New Zealand
Company Name: Unicloud
Contact:

Export template error

Post by rmcdonald »

Hi we are getting the following error in an export template when adding a sub entity report to the template (works fine in other templates?)
Database Error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'select id from app_entity_57 where parent_item_id in (select id from app_enti...' at line 1
Query: select e.* from app_entity_70 e where e.id>0 and e.parent_item_id in (select id from app_entity_68 where parent_item_id in (4196))select id from app_entity_57 where parent_item_id in (select id from app_entity_39 where parent_item_id in ( and e.parent_item_id in (select e.id from app_entity_68 e where e.id>0 and e.parent_item_id in (select item_id from (select e.id as item_id , ( (select MAX(func100.field_1193+0) from app_entity_60 func100 where func100.id>0 and (func100.field_1511 in (723) ) and func100.parent_item_id=e.id ) ) as field_1513, ( (select MAX(func100.field_1686+0) from app_entity_68 func100 where func100.id>0 and func100.parent_item_id=e.id ) ) as field_1690, ( (select count(*) from app_entity_41 func100 where func100.id>0 and (func100.field_463 not in (277,232,271,182,212,112,188,297,213,187,216,171,166,169,167,303,302,301,170) ) and func100.parent_item_id=e.id ) ) as field_767, ( (select count(*) from app_entity_60 func100 where func100.id>0 and func100.parent_item_id=e.id ) ) as field_1539 from app_entity_34 e where e.id>0 and e.parent_item_id in (select e.id from app_entity_57 e where e.id>0 and e.parent_item_id in (select item_id from (select e.id as item_id , (e.field_1611) as field_1616 from app_entity_39 e where e.id>0 ) as parent_entity_39 ))) as parent_entity_34 ))
Page: /Property/index.php?module=items/export_template&path=39-35/57-25/34-4196/68-1&templates_id=4
User avatar
support
Site Admin
Posts: 6215
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Export template error

Post by support »

Looks like conflict with some mysql formula or query. I need more details, now it's not clear what need to fix.
rmcdonald
Investor
Investor
Posts: 417
Joined: 19 Dec 2018, 02:33
Name: Robert McDonald
Location: Auckland, New Zealand
Company Name: Unicloud
Contact:

Re: Export template error

Post by rmcdonald »

Interesting neither the sub entity or parent entity have Mysql formula or query fields in them
rmcdonald
Investor
Investor
Posts: 417
Joined: 19 Dec 2018, 02:33
Name: Robert McDonald
Location: Auckland, New Zealand
Company Name: Unicloud
Contact:

Re: Export template error

Post by rmcdonald »

Still getting error
2021-03-04_18-31-43.jpg
Here are the fields as you can see no queries or formulas
2021-03-04_18-35-18.jpg
Here is the export template
2021-03-04_18-30-29.jpg
rmcdonald
Investor
Investor
Posts: 417
Joined: 19 Dec 2018, 02:33
Name: Robert McDonald
Location: Auckland, New Zealand
Company Name: Unicloud
Contact:

Re: Export template error

Post by rmcdonald »

We are now getting the following error when we try to sort the report by a date field.
Database Error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and ((select count(*) as total from app_entity_88_values cv where cv.items_i...' at line 1
Query: select e.* , (IFNULL(e.field_1870,0)+IFNULL(e.field_1871,0)) as field_1872, (IFNULL(e.field_1792,0)+IFNULL(e.field_1793,0)+IFNULL(e.field_1796,0)) as field_1873, (if(e.field_1809=646,e.field_1663,0)) as field_1905, (if(e.field_1809=645,e.field_1663,0)) as field_1906 from app_entity_88 e where e.id>0 and e.parent_item_id in (select id from app_entity_1 where parent_item_id in (5)) and ((FROM_UNIXTIME(field_1661,'%Y-%m')=date_format(DATE_ADD(now(),INTERVAL 0 MONTH),'%Y-%m')) and e.field_1809 in (646) and (select count(*) from app_entity_88_values as cv where cv.items_id=e.id and cv.fields_id='1808' and cv.value in (119)) >0) and e.parent_item_id in (select item_id from (select e.id as item_id , ( (select MAX(func100.field_1661+0) from app_entity_88 func100 where func100.id>0 and func100.parent_item_id=e.id ) ) as field_1810, ( (select SUM((IFNULL(func100.field_1294,0)+IFNULL(func100.field_1539,0)+IFNULL(func100.field_1291,0))+0) from app_entity_76 func100 where func100.id>0 and func100.parent_item_id=e.id ) ) as field_1747, ( (select SUM((IFNULL(func100.field_1294,0)+IFNULL(func100.field_1539,0)+IFNULL(func100.field_1291,0))+0) from app_entity_76 func100 where func100.id>0 and (func100.field_1272 in (478) ) and func100.parent_item_id=e.id ) ) as field_1748, ( (select SUM((IFNULL(func100.field_1294,0)+IFNULL(func100.field_1
Post Reply