D delphihsc Unregistered / Unconfirmed GUEST, unregistred user! 2003-12-06 #1 G1 广州 300 G1 泉州 400 G2 南平 200 怎么做成这种报表(分组汇总) G1 广州 300 泉州 400 G2 南平 200
W woyaoying Unregistered / Unconfirmed GUEST, unregistred user! 2003-12-06 #2 CREATE TABLE [TABLE3] ( [编号] [char] (10) COLLATE Chinese_PRC_CI_AS NOT NULL , [名称] [char] (10) COLLATE Chinese_PRC_CI_AS NOT NULL , [数量] [int] NULL , CONSTRAINT [PK_TABLE3] PRIMARY KEY CLUSTERED ( [编号], [名称] ) ON [PRIMARY] ) ON [PRIMARY] GO select 编号,名称,数量 from table3 order by 编号 Compute Sum(数量) by 编号 SQL2000下测试通过。
CREATE TABLE [TABLE3] ( [编号] [char] (10) COLLATE Chinese_PRC_CI_AS NOT NULL , [名称] [char] (10) COLLATE Chinese_PRC_CI_AS NOT NULL , [数量] [int] NULL , CONSTRAINT [PK_TABLE3] PRIMARY KEY CLUSTERED ( [编号], [名称] ) ON [PRIMARY] ) ON [PRIMARY] GO select 编号,名称,数量 from table3 order by 编号 Compute Sum(数量) by 编号 SQL2000下测试通过。
D dx2527 Unregistered / Unconfirmed GUEST, unregistred user! 2003-12-06 #3 A1 A2 A3 G1 广州 300 G1 泉州 400 G2 南平 200 兩個adoquery,一個: sql.add('select distinct A1 from tabel'); 另一個: str:= 'select A2,A3 from tabel where A1=''' + adoquery1.fields.fieldbyname('A1').asstring; sql.add(str);
A1 A2 A3 G1 广州 300 G1 泉州 400 G2 南平 200 兩個adoquery,一個: sql.add('select distinct A1 from tabel'); 另一個: str:= 'select A2,A3 from tabel where A1=''' + adoquery1.fields.fieldbyname('A1').asstring; sql.add(str);
D dx2527 Unregistered / Unconfirmed GUEST, unregistred user! 2003-12-06 #6 你將該表看成是master-detail表不就可以了 用qreport的quickrep,上面放一band,為detailband,再放一subdetailband,分別連一adoquery不就可以了