diff --git a/fhem/contrib/statistics/2017/statistics2.cgi b/fhem/contrib/statistics/2017/statistics2.cgi index 7998455c5..2250eb7e5 100755 --- a/fhem/contrib/statistics/2017/statistics2.cgi +++ b/fhem/contrib/statistics/2017/statistics2.cgi @@ -149,7 +149,8 @@ sub doAggregate() { my $nodesTotal = $dbInfo->{'submissionsTotal'}; my $nodes12 = 0; - $sql = q(SELECT geo,json FROM jsonNodes WHERE lastSeen > $limit AND uniqueID <> 'databaseInfo'); + $sql = "SELECT geo,json FROM jsonNodes WHERE uniqueID <> 'databaseInfo' "; + $sql .= "AND geo <> '' AND json <> '' and lastseen > $limit"; $sth = $dbh->prepare( $sql ); $sth->execute(); @@ -230,4 +231,4 @@ sub viewStatistics() { 1; -# \ No newline at end of file +#