在运行统计时出错,提示如下: project server.exe raised exception class EOLeException with message'语法错误 (操作符丢失) 在查询表达式' count(distinct b.服务编号)'中。'.process stopped . use step or run to continue.
procedure TForm_gather.gather_zero; //按服务性质统计 var sqlstr:string; begin StringGrid1.ColCount:=5; StringGrid1.DefaultColWidth:=118; StringGrid1.Cols[0].Add('服务性质'); StringGrid1.Cols[1].Add('服务点数'); StringGrid1.Cols[2].Add('点数比例'); StringGrid1.Cols[3].Add('服务次数'); StringGrid1.Cols[4].Add('次数比例'); StringGrid1.RowCount:=StringGrid1.RowCount+1; sqlstr:='select a.服务性质,count(b.出厂编号),count(distinct b.服务编号)'; sqlstr:=sqlstr+#13+'from kind a,serverkind b,server c'; sqlstr:=sqlstr+#13+'where a.服务性质代号=b.服务性质代号 and b.服务编号=c.服务编号'; if condition<>' then sqlstr:=sqlstr+' and ('+condition+')'; sqlstr:=sqlstr+#13+'group by 服务性质'; with query_gather do begin Close; SQL.Clear; SQL.Add(sqlstr); Open; end; end;