I have a cable list (entity 31) which holds a numeric field of cable length [264], a field project number [316], which is of type value from parent entity and a date field [266].
In another entity I like to sum all cable lenths of a specific project and an a certain date.
So I created a field MySQL Query with:
- The cable list (Entity 31) as "Select from entity".
- SUM([264]) as "Select field" and
- [316]=[319] AND DATE(e.date_added)=DATE([266]) as Condition
I don't get an error, it sums all cable lengths with no limitation by the condition.
The debug mode for this entity shows:
Code: Select all
select e.* ,IFNULL((select SUM((msq.field_264+0)) from app_entity_31 msq where msq.field_316=e.field_319 AND DATE(e.date_added)=DATE(msq.field_266) limit 1),0) as field_320 from app_entity_32 e where e.id>0 and e.parent_item_id in (select item_id from (select e.id as item_id from app_entity_25 e where e.id>0 ) as parent_entity_25 ) order by e.date_added desc limit 0, 30
[1.8100]
As per the instruction under https://docs.rukovoditel.net/index.php? ... conditions this should work. SUM([264]) is shown for "Select field" and [316]=[319] is shown for "Condition".
I like to use this dynamically, so I switched this on.
What do I wrong? Some advise is highly appriciated.