From 99b7c21c765eeb1fc9cb4b192e073b37413a7344 Mon Sep 17 00:00:00 2001 From: Daniel Ledda Date: Sat, 14 Nov 2020 15:20:39 +0100 Subject: [PATCH] Almost there --- database.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database.go b/database.go index 176f475..f17edf8 100644 --- a/database.go +++ b/database.go @@ -70,7 +70,7 @@ func getLastSnapshotRecordFromDb() (*SnapshotRecord, error) { func getSnapshotRecordsFromDb(dateSince time.Time) ([]*SnapshotRecord, error) { snapshots := make([]*SnapshotRecord, 0) query := "SELECT `%s`, `%s`, `%s`, `%s`, `%s` FROM `snapshots` WHERE `%s` > %s ORDER BY `id` DESC;" - rows, err := ClimateDb.Query(fmt.Sprintf(query, "id", "temp", "humidity", "co2", "time", "time", dateSince.String())) + rows, err := ClimateDb.Query(fmt.Sprintf(query, "id", "temp", "humidity", "co2", "time", "time", dateSince)) if err != nil { return nil, fmt.Errorf("couldn't execute select query: %w", err) }