01-29-2020, 09:44 PM
I need create a sql report, and try this command
SELECT sum( vtiger_cobropago.amount) as 'Soma Valor', sum(vtiger_cobropago.cost) as 'Soma Custos' , sum(vtiger_cobropago.benefit) as 'Soma Liquido',
COALESCE(CONCAT(vtiger_users.first_name,vtiger_users.last_name),vtiger_groups.groupname)
FROM vtiger_cobropago INNER JOIN vtiger_crmentity ON vtiger_cobropago.cobropagoid = vtiger_crmentity.crmid LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid = vtiger_users.id LEFT JOIN vtiger_groups ON vtiger_crmentity.smownerid = vtiger_groups.groupid WHERE vtiger_crmentity.deleted=0 AND (( vtiger_crmentity.modifiedtime BETWEEN '2020-01-01 00:00:00' AND '2020-01-31 23:59:59') AND (( vtiger_cobropago.paid = '1') )) AND vtiger_cobropago.cobropagoid > 0 group BY COALESCE(CONCAT(vtiger_users.first_name,vtiger_users.last_name),vtiger_groups.groupname)
Working in sql directly command, in mySQL but in SQL reports, not
I think problem is with a user name
How i can solved that?
Thanks!
SELECT sum( vtiger_cobropago.amount) as 'Soma Valor', sum(vtiger_cobropago.cost) as 'Soma Custos' , sum(vtiger_cobropago.benefit) as 'Soma Liquido',
COALESCE(CONCAT(vtiger_users.first_name,vtiger_users.last_name),vtiger_groups.groupname)
FROM vtiger_cobropago INNER JOIN vtiger_crmentity ON vtiger_cobropago.cobropagoid = vtiger_crmentity.crmid LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid = vtiger_users.id LEFT JOIN vtiger_groups ON vtiger_crmentity.smownerid = vtiger_groups.groupid WHERE vtiger_crmentity.deleted=0 AND (( vtiger_crmentity.modifiedtime BETWEEN '2020-01-01 00:00:00' AND '2020-01-31 23:59:59') AND (( vtiger_cobropago.paid = '1') )) AND vtiger_cobropago.cobropagoid > 0 group BY COALESCE(CONCAT(vtiger_users.first_name,vtiger_users.last_name),vtiger_groups.groupname)
Working in sql directly command, in mySQL but in SQL reports, not
I think problem is with a user name
How i can solved that?
Thanks!
Ranieri
eCRM Web
eCRM Web