diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/CarbsDao.kt b/database/src/main/java/info/nightscout/androidaps/database/daos/CarbsDao.kt index 4e76fd1ef2..55779c2470 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/daos/CarbsDao.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/daos/CarbsDao.kt @@ -45,7 +45,7 @@ internal interface CarbsDao : TraceableDao { @Query("SELECT * FROM $TABLE_CARBS WHERE isValid = 1 AND timestamp >= :from AND timestamp <= :to AND referenceId IS NULL ORDER BY id DESC") fun getCarbsFromTimeToTime(from: Long, to: Long): Single> - @Query("SELECT * FROM $TABLE_CARBS WHERE isValid = 1 AND timestamp + duration >= :from AND timestamp <= :to AND referenceId IS NULL ORDER BY id DESC") + @Query("SELECT * FROM $TABLE_CARBS WHERE isValid = 1 AND timestamp + duration > :from AND timestamp <= :to AND referenceId IS NULL ORDER BY id DESC") fun getCarbsFromTimeToTimeExpandable(from: Long, to: Long): Single> @Query("SELECT * FROM $TABLE_CARBS WHERE timestamp >= :timestamp AND referenceId IS NULL ORDER BY id DESC")