这个你可以用主从表的打印方法啊……
即每一个季度进行一次统计,然后一年又有一个总计,这样对吗?
你可以看一下Delphi的demos中的qr3.里面比较详细!:)

解决方案 »

  1.   

    把你打印所用的Query设置成cachedupdates模式,然后查询初12个月的结果,然后再query里面相应的位置添加进去季度汇总,最后打印即可。
    由于query设置成了cachedupdates,因此向query里添加的记录只要不applyupdates,就不会添加到Oracle的基表里去。
      

  2.   

    在dialt或其它中有after或befor事件你可以添加!
      

  3.   

    select month,b from (
    select 月份 month,a b from tablename where 月份 <=3 link 
    select '一季度' month,sum(a) b from tablename where 月份 <= 3 link 
    select 月份 month,a b from tablename where 月份 <=6 and 月份 > 3 link 
    select '二季度' month,sum(a) b from tablename where 月份 <=6 and 月份 > 3 link 
    select  '半年' month,sum(a) b from tablename where 月份 <=6 link 
    select 月份 month,a b from tablename where 月份 <=9 and 月份 > 6 link 
    select '三季度' month,sum(a) b from tablename where 月份 <=9 and 月份 > 6 link 
    select 月份 month,a b from tablename where 月份 <=12 and 月份 > 9 link 
    select '四季度' month,sum(a) b from tablename where 月份 <=12 and 月份 > 9 link 
    select  '下半年' month,sum(a) b from tablename where 月份 >6 link 
    select '全年' month ,sum(a) b from tablename )备注:我两年没用oracle了,忘记了表连接的函数名称,上面就用link 代替,你把它换过来就行.