|
严重感谢WWWWA,根据您的代码我改了一下,最后是:
SELECT format(nz(e.dd,0)+nz(d.dd,0),'#0.##') AS cb, *
FROM [SELECT a.正代号, b.*
FROM 代号对应表 AS a, (SELECT 余额表.币别, right(余额表.代号,4) as 代号, sum(余额表.余额) as dd
FROM 余额表 group by 余额表.币别, right(余额表.代号,4)
) AS b
WHERE b.代号=a.负代号]. AS d LEFT JOIN [SELECT 余额表.币别, right(余额表.代号,4) as 代号, sum(余额表.余额) as dd
FROM 余额表 group by 余额表.币别, right(余额表.代号,4)
]. AS e ON (d.币别=e.币别) AND (e.代号=d.正代号);
因为代号关系不是0+代号,也有1+代号、2+代号的
严重感谢!!!!!!!!!!!!!!!!!!!!!![em02][em02][em02][em02] |
|