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!

random record selection

Status
Not open for further replies.

Moongirl

Technical User
Jul 31, 2001
5
US
I have a table with 200,000 records. I want the user to enter a parameter (check date) and generate a random list of items paid on that date for an audit. The user wishes to look at only 65 paid records in the report. I do not have the capability to do this as a stored procedure and am looking for ways to do this completely in Crystal. I am using Version 8.0. Thanks.
 
Hi,

You may be able to try something simple like...

Create a formula returning last 4 characters of one of your detail fields, e.g. customer reference or bank a/c number.
Group on this formula.

Then just display the top 65 details from each group.

Hth,
Geoff
 
in the Section Expert for the detail lines..add the following formula for a conditional suppress

RecordNumber > 65;

assuming of course every record that you select is used (ie. there is not a second culling of the records using the Record Selection Formula)

if there is that situation (not every record used) then place a formula (called {@rec_count} )in the detail line that counts the displayed records

whilePrintingRecords;
numbervar rec_count;

if onFirstRecord then rec_count := 0;

rec_count := rec_count + 1;

Suppress this formula so it won't be seen in the report

then the formula in the conditional suppress described earlier would be

whilePrintingRecords;

{@rec_count} > 65;

that should work as well

regards Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top