error en query: SELECT f.id AS idficha ,d.id_tipoconcepto ,t.campo AS campoconcepto ,d.descripcion ,d.id AS idconcep ,d.concepto ,d.gratuito AS gratuito ,d.moneda1 AS olcosmon ,d.valor1 AS olcosval ,d.condicion AS condicio ,d.factor AS olcosfac ,d.valor2 AS cocosval ,d.referencia AS referenc ,d.periodicidad AS periodic ,d.operlibres as numlibres ,d.perioplibres FROM fichas_gen f ,fichas_gen_datos d ,fichas_gen_tipos_concepto t WHERE d.id_tipoconcepto=t.id AND f.id_prodcomercial=26888 AND f.id_trimestre= AND f.id=d.id_ficha AND d.STATUS=1 ORDER BY d.id_tipoconcepto 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 f.id=d.id_ficha AND d.STATUS=1 ORDER BY d.id_tipoconcepto' at line 21*1064