I have lookupcombo which displays lastname and firstname, in this format smith,john. I need the query below to the return the results of the history of the name thats in the combobox. What I have doesn't work, works fine if I just go by lastname. can't get it to work off last and first tho. The database is MYSQL.
char Str[40];
DM->ResidentHistoryQ->SQL->Clear();
DM->ResidentHistoryQ->SQL->Add(" SELECT date_mail, last_name, first_name, reason_return ");
DM->ResidentHistoryQ->SQL->Add(" FROM mail ");
sprintf(Str, " WHERE last_name AND first_name = '%s'", txtName->Text.c_str());
DM->ResidentHistoryQ->SQL->Add(String(Str));
DM->ResidentHistoryQ->Open();
any suggestions
Heydyrtt
char Str[40];
DM->ResidentHistoryQ->SQL->Clear();
DM->ResidentHistoryQ->SQL->Add(" SELECT date_mail, last_name, first_name, reason_return ");
DM->ResidentHistoryQ->SQL->Add(" FROM mail ");
sprintf(Str, " WHERE last_name AND first_name = '%s'", txtName->Text.c_str());
DM->ResidentHistoryQ->SQL->Add(String(Str));
DM->ResidentHistoryQ->Open();
any suggestions
Heydyrtt