Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Total of Unsuppressed Records

Status
Not open for further replies.

jcl5

IS-IT--Management
Dec 6, 2002
89
GB
Hi guys

Using CR10 and Oracle 8i

I am trying to create a report that counts all companies who have had a transaction within a time period.
The condition is that the difference between the company start date and the maximum transaction date must be less than 365 days, i.e. the company was less than a year old on the date of it's last transaction.

I have set up a number of formulas to do this:-

Report header:mad:initcount
whileprintingrecords;
numbervar cnt1:=0;

Group header:-@initmaxdate (Grouped on Comp.compno)
whileprintingrecords;
datetimevar max := CDateTime (2003, 01, 01, 00, 00, 00)

Details:-@incr maxdate
whileprintingrecords;
datetimevar max;
max:=maximum({Trans.Trandate},{Comp.compno})

Group footer:-@disp maxdate
whileprintingrecords;
datetimevar max;
max-{Comp.startdate}

Group footer:-@incr count
whileprintingrecords;
numbervar cnt1;
if ({@disp maxdate})<=365
then cnt1:=cnt1+1;

Report footer :- @disp cnt1
whileprintingrecords;
numbervar cnt1;
cnt1

Transaction date is also on the detail line.
Only report footer is not suppressed.

These formulas work and I think I am getting the correct count - but I now want to display the company details in the group header. When I do this I get all companies, i.e. over 365 days also (so I have used the suppress section editor with the formula {@disp maxdate}>365. I want to display a running total against these so I can check my figure but it does not reset for the unsuppressed companies and I can't use the same formula in the running total as it is evaluated later.

Hope this is understandable and appreciate any help whatsoever.

Thanks

jcl5
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top