我做一张财务的记帐凭证,在一个ERP软件中要求选中多行连打印,凭证号作为参数,由于是汇总凭证,所以用SUM对借代分组求和,现在的问题是:每个凭证号的显示页数求不出来(在crystalreport中六条记录一页),我在游标中用count()求记录数,可是返回的是未求和前的记录数,而不是SUM后的记录数,请问高手,应该怎么做,才能求出SUM之后的实际记录数,如:
cursor mycursor is
select field1,field2,sum(field3),sum(field4),a.field_count
from table,(select count(field1) field_count,field2,sum(field3),sum(field4)
from table) a
where ......
谢谢!
cursor mycursor is
select field1,field2,sum(field3),sum(field4),a.field_count
from table,(select count(field1) field_count,field2,sum(field3),sum(field4)
from table) a
where ......
谢谢!
cursor mycursor is
select field1,field2,sum(field3),sum(field4),a.field_count,count(*) over() rcount
from table,(select count(field1) field_count,field2,sum(field3),sum(field4)
from table) a
where ......;rcount存放行数。
我用的是817,没有问题。