当前位置:主页>仓库管理软件> 列表

查询语句太长了,怎么办啊? 找个人记账软件

销售管理软件版1楼: adoquery1.SQL.add(''select case a.flag when 0 then ''''未审批'''' when 1 then ''''通知审批'''' when 2 then''''已批准'''' when 3 then ''''正式采购'''' when 4 then ''''暂收'''' when 5 then ''''结案'''' when 6 then ''''终止'''' when 7 then ''''审核'''' end as flag'');
adoquery1.SQL.add(''select (case b.stockflag when 0 then ''''未进货'''' when 2 then''''结案'''' end) as stockflag '');
adoquery1.SQL.add(''select c.mname,c.mfax,c.mfrdb,d.Unit,d.cpname,d.spectype,d.ltype,d.stype,d.origin,d.cpkind,b.totalmoney,b.memo,a.*,b.*,isnull(b.basenum,0)-isnull(b.factcount,0) leftnum '');
adoquery1.SQL.add(''from cg_nationstock a,cg_stock_list b,cg_manufactureinfo c,cp_info d'');
adoquery1.Open;
这样查询,会出错,如果缩短为一个SELECT语句就可以通过,怎么样改为 用 一个select 换行用++!

2楼: han--bing 有: 48个待答问题, 4个已答问题, 回答了: 0 个问题。 富翁笔记 如个人记账软件

3楼: BS一下!!!

4楼: 说的对就是adoquery1.SQL.add(‘SELECT 。。’+)


‘。。。。。’+

5楼: 你可以先定义一个字符串
s:string;
s:=''select case a.flag when 0 then ''''未审批'''' when 1 then ''''通知审批'''' when 2 '';
s:=s+'' ..........'';//注意别忘了在新加上的语句前加个空格
adoquery1.sql.clear;
adoquery1.sql.add(s);

6楼: 朋友:我不知道你用的是delphix.0,我用delphi7.0、sql server 2000 ado连接,
adoquery视图,点其属性在sql就可以写出select语句。我没有测试,但你写的那
几行是绝对没有问题的。为什么都要在sql.add中加呢?考虑一下吧!

销售管理软件版7楼: adoquery1.SQL.add(''select .mname,c.mfax,c.mfrdb,d.Unit,d.cpname,d.spectype,'');
adoquery1.SQL.add(''d.ltype,d.stype,d.origin,d.cpkind,b.totalmoney,b.memo,'');
adoquery1.SQL.add(''a.*,b.*,isnull(b.basenum,0)-isnull(b.factcount,0) leftnum '');
就行了

8楼: 2002-9-14注册的富翁到现在还没有回答过问题晕

9楼: adoquery1.SQL.Text:=''select * from .....''
+" where ......"
+" and ..........";