|
▼sakaiII さん:
こんにちは。
>デザインビューで開くと、SQL文だけです。
当方のAc2002環境だとデザインビューが出たので申し訳ないです。
SELECT Q.メーカー名, Q.メーカー名_1, Q.メーカー名_2,
Q.数量の合計, Format([数量シェア%]*100,"0.00") AS 式1,
Q.金額の合計, Format([金額シェア%]*100,"0.00") AS 式2
FROM [
SELECT '合計' AS メーカー名, ' ' AS メーカー名_1, ' ' AS メーカー名_2,
Sum(Table_Area.数量) AS 数量の合計,1 AS 数量シェア% ,
Sum(Table_Area.金額) AS 金額の合計, 1 AS 金額シェア%
FROM Table_Area
UNION ALL
SELECT Table_Area.メーカー名, Table_Area.メーカー名_1, Table_Area.メーカー名_2,
Table_Area.数量, Table_Area.数量/DSum('数量',"Table_Area") AS 数量シェア%,
Table_Area.金額, Table_Area.金額/DSum('金額',"Table_Area") AS 金額シェア%
FROM Table_Area
]. AS Q;
もしくは
SELECT Q.メーカー名, Q.メーカー名_1, Q.メーカー名_2,
Q.数量の合計, Format([数量シェア%],"Percent") AS 式1,
Q.金額の合計, Format([金額シェア%],"Percent") AS 式2
FROM [
SELECT '合計' AS メーカー名, ' ' AS メーカー名_1, ' ' AS メーカー名_2,
Sum(Table_Area.数量) AS 数量の合計,1 AS 数量シェア% ,
Sum(Table_Area.金額) AS 金額の合計, 1 AS 金額シェア%
FROM Table_Area
UNION ALL
SELECT Table_Area.メーカー名, Table_Area.メーカー名_1, Table_Area.メーカー名_2,
Table_Area.数量, Table_Area.数量/DSum('数量',"Table_Area") AS 数量シェア%,
Table_Area.金額, Table_Area.金額/DSum('金額',"Table_Area") AS 金額シェア%
FROM Table_Area
]. AS Q;
でいかがでしょうか?
|
|