DbLog: Ordering the Results by TIMESTAMP for the Charting Frontend

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@4625 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
johannnes
2014-01-11 18:47:21 +00:00
parent 295a425423
commit 0fcc02582c

View File

@@ -1047,7 +1047,7 @@ sub prepareSql(@) {
} elsif($userquery eq "getdevices") {
$sql = "SELECT distinct(device) FROM history";
} elsif($userquery eq "timerange") {
$sql = "SELECT ".$xaxis.", VALUE FROM history WHERE READING = '$yaxis' AND DEVICE = '$device' AND TIMESTAMP Between '$starttime' AND '$endtime';";
$sql = "SELECT ".$xaxis.", VALUE FROM history WHERE READING = '$yaxis' AND DEVICE = '$device' AND TIMESTAMP Between '$starttime' AND '$endtime' ORDER BY TIMESTAMP;";
} elsif($userquery eq "hourstats") {
$sql = $hourstats;
} elsif($userquery eq "daystats") {