[Solved] Query won't sort lazarus / 16-Databases ---------------------------------------------------------------------- madref · 2019-01-22 18:27 I have this query: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   cSQL := 'SELECT ' +          'ID, Scheidsrechter AS Referee, Scheids_ID, Divisie AS Division, ' +          'StrFTime("%d-%m-%Y",Datum) AS Date, ' +          'StrFTime("%H:%M",Tijd) AS Time, ' +          '[Team A], [Team B], Seizoen, Wed_ID, ' +          'TBL, Positie AS Position, Systeem AS System, DD ' +          'FROM qry_Overzicht_Evaluaties ' +          'WHERE ' +          '((Seizoen=:Sei_ID) OR :Sei_ID=0) ' +        'AND ' +          '((Scheids_ID=:Scheids_ID) OR :Scheids_ID=0) ' +          'ORDER BY Date DESC, Time DESC;'; When both Sei_ID AND Scheids_ID are 0 (Zero) the query won't sort on Date and Time Does any1 know why? ---------------------------------------------------------------------- madref · 2019-01-23 06:24 Found my own answer It should be Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 'ORDER BY Datum DESC, Tijd DESC;';