select a.termin_id, a.termin_nr, b.dag_navn, DATE_FORMAT(a.termin_dato,'%d.%m') AS termin_dato, a.termin_navn, a.termin_arena, c.arena_navn, termin_dist_h, termin_dist_d,e.stil_navn, f.konk_type_navn, d.Firma, a.termin_status, a.termin_info, g.status_navn, a.termin_status from termin a, dag b, arena c, firma d, stil e, konk_type f, status g where a.termin_dag=b.dag_id and a.termin_firma=d.FirmaNr and a.termin_arena=c.arena_id and a.termin_stil=e.stil_id and a.termin_konk_type=f.konk_type_id and a.termin_status=g.status_id and DATE_FORMAT(termin_dato,'%Y')= order by a.termin_id ascYou 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 a.termin_id asc' at line 1