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!

problems with filtering with a formula

Status
Not open for further replies.

disbudsfru

Programmer
Aug 2, 2001
2
CA
I've got 2 tables ROADS and ROAD_SEC. For each road in ROADS, there are many ROAD_SEC's. Each road has a START_KM and END_KM. This entire length is broken up into multiple ROAD_SEC's each with their own START_KM and END_KM. What I am trying to do is compare the ROAD_SEC with the largest END_KM pertaining to a particular road to the roads END_KM. Sometimes the last ROAD_SEC's END_KM is out of sync with the associated road in ROADS and I would like to list all the ROADS and the associated last ROAD_SEC's which are out of sync.

So I created a summary field on ROAD_SEC.END_KM to calculate the max END_KM of the ROAD_SEC's in the ROADS group, and created a formula called MAX:
{ROAD_CLASS.RCLS_END_METRE_NBR}=Maximum ({ROAD_CLASS.RCLS_END_METRE_NBR},{ROAD.ROAD_ROAD_NAME})
and added this formula to the filters where it should be true.

I get : "Warning returned. Returned warning code: 3. Detail message: formula/record filer/group filter is not a valid formula.

Then: Error in formula: <record selection>.
'{@MAX)' This formula cannot be used because it must be evaluated later.

Can this not be done? Do I have to sort the records and use a function comparing the current records value to the next, to determine the max and filter on it?

Thanks,
Ryan Schroeder
rschroeder@mail.canfor.ca
ryan@millersoftware.ca
 
Is there any reason why no one will reply to my post?

Frustrated,
Ryan
 
You probably put your formula in to the Record Selection formula. You can't use Summary functions when doing record selection.

Instead, put this formula into the Group Selection Formula. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top