Order sales by timestamp (descending)
This commit is contained in:
parent
e24b6c4e5f
commit
69dd1afba5
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue