|
String si,SubStr,name;
si=DateToStr(Date());
SubStr=si.SubString(5,StrToInt(si.Length()-2));/*取出生日期的月和日*/
data->personquery->Close();
data->personquery->SQL->Clear();
data->personquery->SQL->Add("select * from perinf where birthday like '%"+SubStr+"%' ");
data->personquery->Open();
if(data->personquery->RecordCount!=0)
{ while(!data->personquery->Eof)
{
name=data->personquery->FieldValues["name"];
data->personquery->Next();
}
ShowMessage("今天是'"+name+"'的生日,快去送上祝福吧!");
}查询不到结果,可能是sql语句有问题。请各位指教,该如何写
|
|