Order sales by timestamp (descending)

This commit is contained in:
Martin Brodbeck 2018-07-25 16:11:25 +02:00
parent e24b6c4e5f
commit 69dd1afba5

View file

@ -581,7 +581,7 @@ unsigned int Database::loadSales(std::vector<std::unique_ptr<Sale>>& sales,
retCode = sqlite3_prepare_v2(db_,
"SELECT id, source_no, sold_at"
" FROM sales ORDER BY sold_at",
" FROM sales ORDER BY sold_at DESC",
-1, &stmt, nullptr);
if (retCode != SQLITE_OK)
throw std::runtime_error(sqlite3_errmsg(db_));
@ -635,4 +635,4 @@ unsigned int Database::loadSales(std::vector<std::unique_ptr<Sale>>& sales,
}
return count;
}
}