SELECT [Contract and Revenue(2002-2005)].[存档年Year], [Contract and Revenue(2002-2005)].[存档季Quarter], [Contract and Revenue(2002-2005)].[存档月份Month], [Contract and Revenue(2002-2005)].[区域/Area], [Contract and Revenue(2002-2005)].[客户编号/Subscriber Code], [Contract and Revenue(2002-2005)].[合同编号/ Contract Number], [Contract and Revenue(2002-2005)].[客户名称/ Subscriber Name], [Contract and Revenue(2002-2005)].[席位/小时License/Hour], [Contract and Revenue(2002-2005)].[月数/Months], [Contract and Revenue(2002-2005)].[合同金额/Contract Value], [Contract and Revenue(2002-2005)].[签约人/Handled By], [Contract and Revenue(2002-2005)].[开始日期Star Date], [Contract and Revenue(2002-2005)].[结束日期End Date], [Contract and Revenue(2002-2005)].[存档日期], [Contract and Revenue(2002-2005)].[回款金额Accepted], [Contract and Revenue(2002-2005)].[待收金额 Due], [Contract and Revenue(2002-2005)].[坏账Dead], [Contract and Revenue(2002-2005)].[备注 Remark]
FROM [Contract and Revenue(2002-2005)];
union all SELECT [Contract and Revenue(2002-2005)].[存档月份Month] & " 小计" AS 表达式1, "" as t1,[Contract and Revenue(2002-2005)].[存档月份Month] & " 小计" AS t2,"" as t3,"" as t4,"" as t5,"" as t6,"" as t7,"" as t8,"" as t9,"" as t10,"" as t11,"" as t12,"" as t13,"" as t14,"" as t15,"" as t16,Sum([Contract and Revenue(2002-2005)].[合同金额/Contract Value])AS ValueAll
FROM [Contract and Revenue(2002-2005)]
GROUP BY [Contract and Revenue(2002-2005)].[存档月份Month] & " 小计" union all SELECT [Contract and Revenue(2002-2005)].[存档年Year] & "小计" AS 表达式1, "" as t1,[Contract and Revenue(2002-2005)].[存档年Year] & "小计" AS t2,"" as t3,"" as t4,"" as t5,"" as t6,"" as t7,"" as t8,"" as t9,"" as t10,"" as t11,"" as t12,"" as t13,"" as t14,"" as t15,"" as t16,Sum([Contract and Revenue(2002-2005)].[合同金额/Contract Value])AS ValueAll
FROM [Contract and Revenue(2002-2005)]
GROUP BY [Contract and Revenue(2002-2005)].[存档年Year] & "小计"
UNION ALL
select "总计", "" as t1,"总计","" as t3,"" as t4,"" as t5,"" as t6,"" as t7,"" as t8,"" as t9,"" as t10,"" as t11,"" as t12,"" as t13,"" as t14,"" as t15,"" as t16,sum([合同金额/Contract Value])
from [Contract and Revenue(2002-2005)]
ORDER BY [存档月份Month]; |