[TYPO3-english] TYPO3 TS userlisting: using AVG, SUM etc in select SOLVED

Bert Hiddink [BENDOO e-work solutions] hiddink at bendoo.nl
Sun Dec 8 11:21:35 CET 2013


Hello Jigal,

Solved it! Seems that "type" should not be added in the query:

WRONG: selectFields = type, SUM(tx_feuserextrafields_donation{$year}) AS 
total_donation

CORRECT: selectFields = SUM(tx_feuserextrafields_donation{$year}) AS 
total_donation

Thanks again Jigal and Christian!

Regards,
Bert


    10 = CONTENT
    10 {
       table = fe_users
       select {
         selectFields = SUM(tx_feuserextrafields_donation{$year}) AS 
total_donation
         pidInList = {$pidParticipants}
       }
       renderObj=COA
       renderObj {
         10 = TEXT
         10.field=  total_donation
       }
       wrap = <tfoot><tr><td colspan="5">Total {$year}: | </td></tr></tfoot>
    }



On 08-12-13 10:59, Bert Hiddink [BENDOO e-work solutions] wrote:
> Hello Jigal,
>
> Thanks for the tip, I'll try that and report back!
>
> Regards,
> Bert
>
> On 07-12-13 16:44, Jigal van Hemert wrote:
>> Hi,
>>
>> On 6-12-2013 14:22, Bert Hiddink [BENDOO e-work solutions] wrote:
>>> Now I have the snippet as shown below...
>>> However, while the "20"-block renders correctly, the "10"-block does not
>>> render any output.
>>
>> On trick to debug the actual query that was generated is:
>> - set in Install Tool that failing queries are listed (probably also
>> useful to list your IP-address in the devIpMask)
>> - make a deliberate syntax error in the query (e.g. remove first
>> character of table name)
>>
>> Now the query will fail and you'll see the full query above the page
>> output. You can use this query (with the corrected table name) in a
>> database tool (Adminer, PhpMyAdmin, etc.) to test further.
>>
>



More information about the TYPO3-english mailing list