I have defined the following view in a MySQL database:
-------------------------------------------------------------

CREATE VIEW viewVeranstaltungenhp AS
SELECT
  begDatum, /* a column of type DATE */
  begUhrZeit, /* a column of type TIME */
  DATE_FORMAT(v.begDatum,'%d.%m.') as begDatumS, /* extract DAY and MONTH from the date */
  TIME_FORMAT(v.begUhrZeit,'%H:%i') as begUhrZeitS,  /* extract HOUR and MINUTE from the time */
  v.bezeichnung as Veranstaltung, 
  v.ort as Ort, 
  sv.code as Status, 
  v.bemerkung as Bemerkung  
FROM
 (veranstaltungen v
  join statusVeranstaltung sv on sv.veranstNr = v.nummer 
 )
WHERE 
 EXTRACT(YEAR FROM begDatum) >= EXTRACT(YEAR FROM CURRENT_DATE()) and
 sv.code != 4 and 
 sv.datum = (select max(svv.datum) from statusVeranstaltung svv where svv.veranstNr = v.nummer) 
order by
 v.begDatum DESC, v.begUhrZeit DESC
;

--------------------------------------------------------
This view is the base for a Forena report. As can be seen, the resulting database records should be sorted
"DESC". As an aside, the view is for showing events of a wind band I am a member of, and they should be
shown with the latest (most recent or future) event at the top. Unfortunately the "order by" clause seems
to be ignored. The events are shown in ascending order of the day. How can this be accomplished? Of
course - in THIS "neck of the woods" we show the day before the month.

Comments

hstoellinger created an issue. See original summary.

hstoellinger’s picture

Hello,
I don't know why -- but all of a sudden the sorting order is just like I intend it to be. So - everything is fine...
Regards
H. Stoellinger

metzlerd’s picture

Status: Active » Closed (cannot reproduce)

Glad to hear....