Fatal error: Uncaught exception 'Doctrine_Connection_Mysql_Exception' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 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 'WHERE s.soc_excluido = 0 AND soc_tipo='Representativo' AND s.soc_id NOT IN (SELE' at line 1. Failing Query: " select count(*) as total FROM socio s INNER JOIN clube c ON s.clb_id = c.clb_id AND c.clb_tipo=1 AND c.dst_id= WHERE s.soc_excluido = 0 AND soc_tipo='Representativo' AND s.soc_id NOT IN (SELECT a.soc_id FROM associado_historico a WHERE a.ash_acao='Baixa' AND a.ash_data <= '2019-09-21') AND s.soc_sexo='M'"' in /home/unyclub/public_html/ipanel/app/core/doctrine/Doctrine/Connection.php:1082 Stack trace: #0 /home/unyclub/public_html/ipanel/app/core/doctrine/Doctrine/Connection.php(1025): Doctrine_Connection->rethrowException(Object(PDOException), Object(Doctrine_Connection_Mysql), ' select count(*...') #1 /home/unyclub/public_html/ipanel/app/contro in /home/unyclub/public_html/ipanel/app/core/doctrine/Doctrine/Connection.php on line 1082