error previo -2147217900 - AI Incorrect syntax near 'and'.select distinct e.id, e.nombre, e.apodo2, e.idTanatorio, tanatorio,p.ayuntamiento,e.provincia,p.lugar,e.fechaF from v_Esquelas_actos_gal e, poblaciones p where e.IdPobFallecimiento=p.idpob and (e.Fecha Between '29/10/2026' and '01/11/2026') and (exists (select * From iglesias i where i.id = e.idIglesia and (provincia in ('PONTEVEDRA') or poblacion in (''))) or exists (select * From iglesias i where i.id = e.idIglesia2 and (provincia in ('PONTEVEDRA') or poblacion in (''))) or exists (select * From tanatorios i where i.id = e.idTanatorio and (provincia in ('PONTEVEDRA') or poblacion in (''))) or exists (select * From nombre n where n.idFuneraria = e.idFuneraria and (provincia in ('PONTEVEDRA') or poblacion in (''))) or exists (select * From poblaciones p where p.idPob = e.idPobFallecimiento and (provincia in ('PONTEVEDRA') or ayuntamiento in (''))) or exists (select * From Esquelas_publicaciones p where p.idEsquela=e.Id and idDominio in (5))) and idPobFallecimiento in (select idPob from poblaciones where ( and provincia like 'PONTEVEDRA' collate Modern_Spanish_CI_AI and ayuntamiento like 'Silleda' collate Modern_Spanish_CI_AI )) and isnull(tipo,'')='' order by e.provincia, nombre