delphi 中SQL语句的问题
selecta.outdate结存日期,e.techname结存工序,a.pdctno生产型号,(casewhenc.mmkbin('母板','子板')then'是'el...
select a.outdate 结存日期,e.techname 结存工序,a. pdctno 生产型号,(case when c.mmkb in ('母板','子板') then '是' else '否' end ) HDI标识,
a.procwip 结存数量,a.procwip*c.unitarea 生产面积
from prorcsb a join mktxhglb c on a.pdctno=c.pdctno
left join (select distinct techno,techname from pubgyxxb) e on e.techno=a.techno
where a.outdate= '2009-05-01' and a.procwip>0
order by a.outdate 这段代码怎么在adoquery中实现,需要怎么改? 展开
a.procwip 结存数量,a.procwip*c.unitarea 生产面积
from prorcsb a join mktxhglb c on a.pdctno=c.pdctno
left join (select distinct techno,techname from pubgyxxb) e on e.techno=a.techno
where a.outdate= '2009-05-01' and a.procwip>0
order by a.outdate 这段代码怎么在adoquery中实现,需要怎么改? 展开
2013-09-07
展开全部
单引号的加上双引号即可。 adoquery.Close;adoquery.SQL.Clear;adoquery.SQL.Text:= 'select a.outdate 结存日期,e.techname 结存工序,a. pdctno 生产型号,'+' (case when c.mmkb in (''母板'',''子板'') then ''是'' else ''否'' end ) HDI标识,'+
' a.procwip 结存数量,a.procwip*c.unitarea 生产面积'+
' from prorcsb a join mktxhglb c on a.pdctno=c.pdctno'+
' left join (select distinct techno,techname from pubgyxxb) e on e.techno=a.techno'+
' where a.outdate= ''2009-05-01'' and a.procwip>0'+
' order by a.outdate';adoquery.Open;
' a.procwip 结存数量,a.procwip*c.unitarea 生产面积'+
' from prorcsb a join mktxhglb c on a.pdctno=c.pdctno'+
' left join (select distinct techno,techname from pubgyxxb) e on e.techno=a.techno'+
' where a.outdate= ''2009-05-01'' and a.procwip>0'+
' order by a.outdate';adoquery.Open;
2013-09-07
展开全部
var str:string;beginstr:='select a.outdate 结存日期,e.techname 结存工序,a. pdctno 生产型号,(case when c.mmkb in (''母板'',''子板'') then ''是'' else ''否'' end ) HDI标识,
a.procwip 结存数量,a.procwip*c.unitarea 生产面积
from prorcsb a join mktxhglb c on a.pdctno=c.pdctno
left join (select distinct techno,techname from pubgyxxb) e on e.techno=a.techno
where a.outdate= ''2009-05-01'' and a.procwip>0
order by a.outdate';adoquery1.close;adoquery1.sql.clear;adoquery1.sql.add(Str);adoquery1.open;这样就行了~
a.procwip 结存数量,a.procwip*c.unitarea 生产面积
from prorcsb a join mktxhglb c on a.pdctno=c.pdctno
left join (select distinct techno,techname from pubgyxxb) e on e.techno=a.techno
where a.outdate= ''2009-05-01'' and a.procwip>0
order by a.outdate';adoquery1.close;adoquery1.sql.clear;adoquery1.sql.add(Str);adoquery1.open;这样就行了~
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询