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 'AND group by m.idpromo' at line 1
SELECT m.idpromo as idpromo, SUM(d.cant-d.cantdev) as cantneta, SUM((d.cant-d.cantdev) * d.pf*(1+d.pjeiva)) as importe, SUM((d.cant-d.cantdev) * d.pf*(1+d.pjeiva)) / SUM(d.cant-d.cantdev) as precioprom from vremdet d INNER JOIN vrem m ON d.idvrem = m.idvrem INNER JOIN art a ON d.idart = a.idart where a.esprecioprom=1 AND m.fecha BETWEEN '' AND '' AND AND group by m.idpromo