Fixing DB Range problems.

This commit is contained in:
stephb9959
2021-08-04 20:12:11 -07:00
parent 999872e580
commit 0ad8c9e90c
3 changed files with 4 additions and 4 deletions

View File

@@ -138,7 +138,7 @@ namespace uCentral {
DevicesRecordList Records;
std::string St{"select " + DBFIELDS_DEVICES_SELECT + " from " + DBNAME_DEVICES + " ORDER BY SerialNumber "};
std::string St{"select " + DBFIELDS_DEVICES_SELECT + " from " + DBNAME_DEVICES + " ORDER BY SerialNumber ASC "};
Select << ConvertParams(St) + ComputeRange(From, HowMany),
Poco::Data::Keywords::into(Records);
Select.execute();

View File

@@ -246,11 +246,11 @@ namespace uCentral {
std::string st;
if(Compatible.empty()) {
st = "SELECT " + DBFIELDS_FIRMWARES_SELECT + " FROM " + DBNAME_FIRMWARES + " ORDER BY Id ";
st = "SELECT " + DBFIELDS_FIRMWARES_SELECT + " FROM " + DBNAME_FIRMWARES + " ORDER BY Id ASC ";
Select << ConvertParams(st) + ComputeRange(From, HowMany),
Poco::Data::Keywords::into(Records);
} else {
st = "SELECT " + DBFIELDS_FIRMWARES_SELECT + " FROM " + DBNAME_FIRMWARES + " where DeviceType=? ORDER BY Id ";
st = "SELECT " + DBFIELDS_FIRMWARES_SELECT + " FROM " + DBNAME_FIRMWARES + " where DeviceType=? ORDER BY Id ASC ";
Select << ConvertParams(st) + ComputeRange(From, HowMany),
Poco::Data::Keywords::into(Records),
Poco::Data::Keywords::use(Compatible);

View File

@@ -47,7 +47,7 @@ namespace uCentral {
Poco::Data::Statement Select(Sess);
std::string st{"SELECT " + DBFIELDS_HISTORY_SELECT +
" FROM " + DBNAME_HISTORY + " where SerialNumber=? ORDER BY Upgraded " };
" FROM " + DBNAME_HISTORY + " where SerialNumber=? ORDER BY Upgraded DESC " };
Select << ConvertParams(st) + ComputeRange(From, HowMany),
Poco::Data::Keywords::into(Records),