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!

difficulty getting a count

Status
Not open for further replies.

Oscar115

Technical User
May 21, 2010
30
US
I have a main report that establishes a date array based upon date range parameters (prompted).

I am sending the value of the date array to a subreport contained in the details of the main report (Date Range Array Variable).

I am evaluating whether the date array value is within the start and end date of the records and if the record has a specific status.

I am able to evaluate whether the date array value is within the date range.

I am able to evaluate whether the status has the value I am looking for.

I am able to put the two of these together and get the correct True/False value.

However I cannot get a count of those records that fit both these conditions.

I have tried a running total and a distinctcount.
I have assigned a value of 1 to the record if it meets both conditions and have tried to sum the values. Each time I get an error.

Thanks
 
With my running total using formula:
{@Date Range Array Variable} in {lrunitst.start_dt} to {@enddatetime} and {lrunitst.cdesc}='Downtime'

I am getting error:
A running total cannot refer to a print time formula
Details: @Date Range Array Variable

and with a distinctcount attempt:
distinctcount({@Downtime ?},{lrunit.cprojno})

where @Downtime ? is:
{@Date Range Array Variable} in {lrunitst.start_dt} to {lrunitst.end_dt} and {lrunitst.cdesc}='Downtime'

getting error: This field cannot be summarized.

 
I wish you would rename the value you are passing to the subreport, as you are passing one date at a time, which was created using an array. When you link on the formula {@Date Range Array Variable} it creates a field in the subreport that looks like this:

{?pm-@Date Range Array Variable}

It is this that you should be referencing in your formulas, as the formula itself is not IN the subreport.

-LB
 
LB,
This is not what I am referring to.
I was able to locate other threads in which you had provided direction to others. Basically, initializing the variables in the group header, incrementing each running total when the condition is met, and then create a display formula for the variable and place it in the group footer.

Everything is working now.

Once again, thanks for all you help!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top