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

Evaluate a formala against a parameter

Status
Not open for further replies.

khoke

Programmer
Jul 8, 2005
20
US
I am using CR 10, and want to select records based on a sum.
For example, I want to select all groups who have a total number of hours less than my parameter.

Parameter (number)= @Hours
Group 1 = @EmployeeName
@TotalHours = Sum (ClockHours, @EmployeeName)

I want to display records when @Hours > @TotalHours

Suppressing the records work, (on the detail level,) but I cannot suppress the group headers based on @TotalHours.

I get an error message stating the formula cannot be used, since it must be evaluated later.

How do I get the formula to evalutate first?
Thanks!
 
You can use the Group Selection formula to limit the report based on on any group total you have calculated.

Report>SelectionFormula>Group
 
When I try to add this
@Hours > @TotalHours
to my group selection formala, I get an error message highlighting @TotalHours stating, "The formula cannot be used becuase it must be evaluated later.
 
I thought you said you were using a parameter field as the cut off point?

I would expect to see a selection formula looking something like:

Sum((mytable.mydatafield}, {mytable.Mygroupfield})>?myparam
 
I apologize for not being as clear- posting with you is helping me understand this a little better... thanks!

This is what I want to do, overall-

Group 1- table.Dept
Group 2- table.Unit
Group 3- @Employee (this is where @TotalHours will print.)
Details (This is always supressed.)

if @Hours (my parameter) > @TotalHours
then suppress (or do not print at all:)

Group 3- @Employee (I can suppress this group in the section detail.)

If there are no printed records in Group 3 for each Group 2, then suppress or do not print Group 2

If there are no printed records in Group 2 for each Group 1, then suppress or do not print Group 1

Is this possible?
THANKS!



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top