Error
Se produjo un error al acceder a la base de datos
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=0 OR r.idruta=) AND (r.impvenc>0 OR c.importe>0)' at line 1
select count(*), sum(r.impvenc), sum(COALESCE(c.importe,0)) from vrem r LEFT JOIN person p ON r.idcte=p.idperson LEFT JOIN vremcargo c ON r.idvrem=c.idvrem AND c.perextra=1 AND c.fecha BETWEEN '' AND '' where (=0 OR r.idruta=) AND (r.impvenc>0 OR c.importe>0)