Fix a bug in search engine

This commit is contained in:
Grégory Soutadé 2011-01-29 11:41:43 +01:00
parent 63ccfc7f97
commit 0dc15fdb7b

View File

@ -1291,7 +1291,8 @@ std::vector<Operation>* Database::Search(User* user, wxString* description, wxDa
if (firstCond) req += wxT(" AND ") ; else firstCond = true;
req += wxT("(");
req += wxT("year >= ") + yearFrom ;
req += wxT(" AND (month > '") + monthFrom + wxT("' OR (month == '") + monthFrom + wxT("' AND day >= '") + dayFrom + wxT("'))");
req += wxT(" AND (month > '") + monthFrom + wxT("' OR (month == '") + monthFrom + wxT("' AND day >= '") + dayFrom + wxT("')");
req += wxT(" OR (month < '") + monthFrom + wxT("' AND year > '") + yearFrom + wxT("'))");
req += wxT(")");
}
@ -1300,7 +1301,8 @@ std::vector<Operation>* Database::Search(User* user, wxString* description, wxDa
if (firstCond) req += wxT(" AND ") ; else firstCond = true;
req += wxT("(");
req += wxT("year <= ") + yearTo ;
req += wxT(" AND (month < '") + monthTo + wxT("' OR (month == '") + monthTo + wxT("' AND day <= '") + dayTo + wxT("'))");
req += wxT(" AND (month < '") + monthTo + wxT("' OR (month == '") + monthTo + wxT("' AND day <= '") + dayTo + wxT("')");
req += wxT(" OR (month > '") + monthTo + wxT("' AND year < '") + yearTo + wxT("'))");
req += wxT(")");
}