看看这段代码:(查询当天的报警)
float Ayear;
float Amonth;
float Aday;
string temp;
string StartDate;
string EndDate;
Ayear= \\本站点\$年;
Amonth= \\本站点\$月;
Aday= \\本站点\$日;
temp=StrFromInt( Ayear, 10 );
if(Amonth<10)
temp=temp+"/0"+StrFromInt( Amonth, 10 );
else
temp=temp+"/"+StrFromInt( Amonth, 10 );
if(Aday<10)
temp=temp+"/0"+StrFromInt( Aday, 10 );
else
temp=temp+"/"+StrFromInt( Aday, 10 );
StartDate = temp;
trace("StartDate=%s",StartDate);
trace("EndDate=%s",EndDate);
string whe;
whe = "AlarmDate = ‘" + StartDate + "‘ ORDER BY AlarmDate ASC";
Ctrl_AlarmQuery.Where = whe;
trace("查询条件【当日数据】:%s",Ctrl_AlarmQuery.Where);
Ctrl_AlarmQuery.FetchData();
Ctrl_AlarmQuery.FetchEnd();