SQL语句结束的地方缺少‘;’,求解
编绎成功,点击按扭后弹出错误:sql语句的结束位置缺少';'
procedure TfCosting.btnCalculateClick(Sender: TObject);var ss:string;begin showmessage(strsql); if Length(strsql)>0 Then ss:=' where t2.FNumber in ('+Copy(strsql,1,Length(strsql)-1)+') and t2.ffactory = ' + quotedstr(cmbfactory.Text) + ' and t2.fyear = ' + quotedstr(cmbyear.Text) + ' and t2.fperiod = ' + quotedstr(cmbperiod.Text) ; ss:= ss + ' GROUP BY t2.FYear,t2.FPeriod,t2.FFactory '; with datamd.ADOCalculateTemp do begin close; sql.Clear; sql.Text := 'update t_calculateTemp t1,t_overhead t2 set t1.FAmount = SUM(t2.FAmount) '; sql.Text := sql.Text + ss ; showmessage(sql.Text ); //执行完这句后出错,请问是怎么回事,Showmessage(sql.text)的结果如图 execsql; showmessage('成功'); end; //更新单位PCS 所摊费用 with datamd.ADOCalculateTemp do begin close; sql.Clear; sql.Text := 'update t_capacity t2,t_calculateTemp t1 set t1.FAmount_PER = t1.famount/t2.ftotal where t1.FYear=t2.fyear and t1.FPeriod=t2.fperiod and t1.FFactory=t2.FFactory '; showmessage(sql.Text ); execsql; showmessage('成功'); end;end;