sql.text:= insert into rep仓库收付存月结报表(mc,ycjcje,bqsrje,bqllje,qmjcje) +
(select sorttype,sum(qc*inprice),sum((rk-rkt)*inprice),sum((ck-ckt)*inprice),sum(jc*inprice) + 【程序编程相关:让Fastreport3.x支持中文PD】 【推荐阅读:我用Delphi实现的Singleton】 from tmpkk2 where 1=1 +sdepot+stmp + group by sorttype ) ; 【扩展信息:拷贝DBGrid当前行 】 execsql; function getpartfilter(aid: string): string; var querytemp: toceanquery; s: string; lownerids: tstringlist; procedure getownerids(aid: string); var lquery: toceanquery; begin lquery := toceanquery.create(nil); try lquery.close; lquery.sql.text := select id from partinfo where ownerid= + quotedstr(aid) + and id<> + quotedstr(aid) + and imageindex=0; lquery.open; while not lquery.eof do begin lownerids.add(lquery.fieldbyname(id).asstring); getownerids(lquery.fieldbyname(id).asstring); lquery.next; end; finally lquery.free; end; end; var i: integer; begin result := ; querytemp := toceanquery.create(nil); lownerids := tstringlist.create; try querytemp.close; querytemp.sql.text := select id,imageindex from partinfo where id= + aid + ; querytemp.open; if querytemp.isempty then exit; ... 下一页