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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Total Error

Status
Not open for further replies.

ccnetwork

Technical User
Feb 5, 2007
12
GB
Hello

When I run my report I get the following error message:
A running total cannot refer to a print time formula.

I think the reason I am getting this error message is because my formula dates are worked out in a subreport then passed to the main report for processing.

The subreport works out the start date and end date for each month based on a year parameter. Not all the start, end dates are the same for a specific month. E.g

Start date for April 2004 is 28/3/2004 (dd/mm/yyyy)
Start date for April 2007 is 29/3/2004 (dd/mm/yyyy)

Below is an example of the running total that displays the error message. Is it possible to create a formula instead of a running total to work out the information?


Running Total Name: Volume Expected April
Field to summarize: L_FUNDING.Learner_ID
Type of summary: Count
Evaluate Formula:{L_FUNDING.DateStart}>= {Period1From} and {L_FUNDING.DateStart}<= {Period1To}
Reset: Group By Advisor


Any help will be greatly appreciated.
 
So Period1From and Period1To are shared variables? You can write a formula in the main report like this:

//{@accum} to be placed in the detail section (below the section containing the sub):
whileprintingrecords;
shared datevar Period1From;
shared datevar Period1To;
numbervar cnt;

if {L_FUNDING.DateStart}>= Period1From and {L_FUNDING.DateStart} <= Period1To then
cnt := cnt + 1;

Add a reset formula to the advisor group header:
whileprintingrecords;
numbervar cnt;
if not inrepeatedgroupheader then
cnt := 0;

(if the sub is in a group section, you should also reset the shared variables.)

In the advisor group footer, use this display formula:

whileprintingrecords;
numbervar cnt;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top