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

How Can I use the Maximum of a field in Record Selection

Status
Not open for further replies.

CharleyBrown

Technical User
Sep 5, 2002
10
NZ
I have a simple report that brings back the details from an error log table for all the cheque runs. One of the fields is 'Run Number'. I only want the details for the last run number. I tried to used the Maximum fuction in the record selection (you live in hope!) but that came back with the message that that function cannot be used because it is evaluated later. I created a view of the error log table which creates the field MaxRunNumber and tried to use this in the record selection i.e. RunNumber = errorlog_vw.MaxRunNumber and get nothing returned. I also tried using the errorlog_vw.MaxRunNumber as a condition to suppress the details section where RunNumber < errorlog_vw.MaxRunNumber - this didn't work either :-(. When I look at errorlog_vw.MaxRunNumber the correct maximum run number is there. I am using CR v8.5. Any help would be gratefully received!
 
If the view only returns the maxrunnumber, just use it as the data source, you don't need a record selction.

Of course you've explained nothing about the report, not anything technical, so I may be mistaken.

Try supplying technical information, such as Crystal version, database and connectivity, example data and expected output.

-k
 
OK, Crystal v8.5 (as mentioned in the original post), ODBC connectivity to SQL server 2000 database. I will try putting more fields in the view and using that as the primary data source. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top