diff --git a/src/model/stat.rs b/src/model/stat.rs index 10384b9..7199ce8 100644 --- a/src/model/stat.rs +++ b/src/model/stat.rs @@ -30,7 +30,7 @@ impl BoatStat { SELECT boat.id, location.name AS location, - CAST(strftime('%Y', arrival) AS INTEGER) AS year, + CAST(strftime('%Y', COALESCE(arrival, 'now')) AS INTEGER) AS year, CAST(SUM(COALESCE(distance_in_km, 0)) AS INTEGER) AS rowed_km FROM boat