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

Record selection -- first few records only 1

Status
Not open for further replies.

rleyba828

Technical User
Sep 29, 2004
53
US
Some of my reports are normally 500,000 to a couple of million records long. Often, while testing, I would want to limit the record selection to say, first 20,000 records only.

For the record selection criteria, I tried using the formula recordnumber<20000 but it keeps saying "Function cannot be used because it must be evaluated later." I even tried playing with Whilereadingrecords or whileprintingrecords, etc. but it keeps showing the same error message.

How do I force the report so select the first few records only?

I am using Crystal version 8.

Thanks very much.
 
Hi,
If you have access to the database, create a view that only has a subset of the records and use that for testing..You did not specify the datasource so I cannot be more specific..
( In Oracle you could use:
Code:
Create or Replace View Test_Records_V as
Select * from big_table where rownum < 20000;
)






[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Just hit the stop button after this has run enough to get the records you desire. You will be prompted to return the records found so far.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Thanks very much guys.....just one thing. Is it because i am using an old version of CR (8) that's why the Recordnumber function doesn't work or there is really no way to do this kind of record selection even with a later version of CR?



 
What do you mean recordnumber doesn't work? Please elaborate,

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
You can't use recordnumber in a selection formula, since it is simply based on sequence.

For testing, I usually limit records by requiring an ID field to be greater than a certain number or by limiting records to a few days time.

-LB
 
OK, thanks again. Anyway, to answer your question dgillz, I was hoping to find a way to be able to control the processing of my dataset to only a few records at a time, while I fine tune formulas, layouts, etc. The original data is in csv format and it is the output of a network monitoring program. Unfortunately there are no index or sequence numbers from the raw data which I can use to limit the records processed.

However, lbass' comment sparked something. One of my fields is a date-time field. I can use this to filter out records constituing a day's worth of logs or something, instead of one week's data.

This should work. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top