From fa4cf31cf49fc8bca622889e19bd4d913f9bd824 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Wed, 7 Dec 2016 01:22:47 +0100 Subject: [PATCH] Correct db query --- .../java/info/nightscout/androidaps/db/DatabaseHelper.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java b/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java index 4717f6e237..faafbb39fc 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java +++ b/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java @@ -196,8 +196,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper { QueryBuilder queryBuilder = daoBgreadings.queryBuilder(); queryBuilder.orderBy("timeIndex", true); Where where = queryBuilder.where(); - where.ge("timeIndex", mills); - queryBuilder.where().gt("value", 38); + where.ge("timeIndex", mills).and().gt("value", 38); PreparedQuery preparedQuery = queryBuilder.prepare(); bgReadings = daoBgreadings.query(preparedQuery); return bgReadings;