Counter /report 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:

Counter /report error

Post by rmcdonald »

Getting the following error when trying to create a counter filtered for overdue dates only on a dynamic date field

Database Error: 1052 - Column 'field_1985' in having clause is ambiguous
Query: select e.* , (e.field_2069) as field_1985 from app_entity_52 e where e.id>0 and (e.field_1451 not in (688,689) and (select count(*) as total from app_related_items_52_56 ri where (ri.entity_52_items_id=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 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_1516, ( (select count(*) from app_entity_52 func100 where func100.id>0 and (func100.field_1451 in (687) ) and func100.parent_item_id=e.id ) ) as field_1549, ( (select count(*) from app_entity_56 func100 where func100.id>0 and (func100.field_1402 in (732,634) ) and func100.parent_item_id=e.id ) ) as field_1550, ( (select count(*) from app_entity_76 func100 where func100.id>0 and (func100.field_1713 in (432,431,434,435) ) and func100.parent_item_id=e.id ) ) as field_1843,IFNULL((select GROUP_CONCAT(id) from app_entity_1 msq where id IN ( SELECT items_id FROM app_entity_1_values WHERE fields_id=1915 AND value=e.id ) limit 1),0) as field_1916 from app_entity_34 e where e.id>0 and (e.field_1427 in (468) ) and e.parent_item_id in (select e.id from app_entity_39 e where e.id>0 and e.parent_item_id in (select e.id from app_entity_66 e where e.id>0 and (( find_in_set(509,(select GROUP_CONCAT(id) from app_entity_1 msq where id IN ( SELECT items_id FROM app_entity_1_values WHERE fields_id=1661 AND value=e.id ) limit 1)))) ))) as parent_entity_34 ) having (FROM_UNIXTIME(field_1985,'%Y-%m-%d')<date_format(now(),'%Y-%m-%d') and field_1985>0)
Page:index.php?module=dashboard/reports_groups&id=33
User avatar
support
Site Admin
Posts: 6222
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Counter /report error

Post by support »

Just add zero in formula
Attachments
screenshot-localhost-2021.12.01-08_04_20.png
Post Reply