error en query: SELECT i.IdInstiFin, i.NOMBREIF, i.IdStatusBuro, c.CumpleSIPRES, c.CumpleRECA, c.CumpleRECO, c.CumpleREUNE, c.CumpleUNE, c.CumpleIFIT, c.CumpleREDECO, c.CumpleCalificacion, c.IdPeriodo, i.C_SECSHCP, cs.IdActividad, a.ActividadNombre, cs.IdAsociacion, b.AsoNombre, cs.RecoNoObs, cs.IdEdoRenovacion, e.edufin_aplica FROM bef_InstFin AS i Inner Join bef_RegCumplimiento AS c ON i.IdInstiFin = c.IdInstFin AND i.IdPeriodo = c.IdPeriodo left Join bef_ComportamientoGralSOFOM AS cs ON i.IdInstiFin = cs.IdInstFin AND i.IdPeriodo = cs.IdPeriodo left Join bef_catActividad AS a ON cs.IdActividad = a.id left Join bef_catAsociacion AS b ON cs.IdAsociacion = b.id left Join bef_ifit_edufin AS e ON i.IdInstiFin = e.id_institucion AND i.IdPeriodo = e.IdPeriodo WHERE i.C_SECSHCP = 69 AND i.IdStatusBuro = 2 AND i.IdPeriodo = ORDER BY i.NOMBREIF 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 'ORDER BY i.NOMBREIF' at line 33