{"orden":"","sql":" SELECT SQL_CALC_FOUND_ROWS (SELECT CONCAT(nom003,' ',ape003) FROM st003 WHERE id003=reg021) As Usuario,a.* FROM (\n\tSELECT reg021, fcr021, \"Nuevo Prospecto\" As Tipo, emp021, \"\" AS Contacto, \"\" AS Descripcion, \"\" As obs\n\t\tFROM de021 WHERE DATE_FORMAT(fcr021,'%Y-%m-%d') BETWEEN '2018-1-21' AND '2018-02-21' \n\tUNION\n\tSELECT res024, ufa024, \"Eventos Manuales\", (SELECT emp021 FROM de021 WHERE de021.id021=de024.id021), \n\t\t(SELECT des554 FROM cr554 WHERE mct024=id554) , des024, obs024 \n\t\tFROM de024 WHERE DATE_FORMAT(ufa024,'%Y-%m-%d') BETWEEN '2018-1-21' AND '2018-02-21'\n\tUNION\n\tSELECT rcr022, fcr022, \"Evento en Lead\", (SELECT emp021 FROM de021 WHERE de021.id021=de022.id021), \n\t\t(SELECT des554 FROM cr554 WHERE mct022=id554) , des022, obs022 \n\t\tFROM de022 WHERE DATE_FORMAT(fcr022,'%Y-%m-%d') BETWEEN '2018-1-21' AND '2018-02-21'\n\tUNION\n\tSELECT rcr256, fcr256, \"Nuevo Ticket\", IF(id004>0,(SELECT emp021 FROM de021 WHERE de021.id004=cr256.id004),\"\"), \"\", des256\n ,\"\"\n FROM cr256 WHERE DATE_FORMAT(fcr256,'%Y-%m-%d') BETWEEN '2018-1-21' AND '2018-02-21'\n\tUNION\n\tSELECT rcr257, fcr257, \"Evento Ticket\", (SELECT emp021 FROM de021 WHERE de021.id004=(SELECT id004 FROM cr256 WHERE cr256.id256=cr257.id256) LIMIT 1), \n\t\tIFNULL( (SELECT des554 FROM cr554 WHERE cr257.id554=cr554.id554), \"Autom\u00e1tico\"), des257, obs257 \n FROM cr257 \n\t\tWHERE DATE_FORMAT(fcr257,'%Y-%m-%d') BETWEEN '2018-1-21' AND '2018-02-21'\n) AS a \n WHERE 1 ","data":[],"msg":"No hay datos"}