Very simple Crystal reports question, limit number of rows in result set.

Posted on 2006-06-06
Medium Priority
Last Modified: 2008-01-09
This should be an easy one.  I want to duplicate the sql equivalent of "Select Top 2 ..." in Crystal reports.
I have a very simple report that has no grouping and only returns two fields.  I simply need it to return no more than 2 rows.  I can't find a way to do this simple task in Crystal Reports 10.  I have been reading the help for the past hour and came up with the topcount() function but don't know where to put the command, I get errors when I create a regular function.  Please help.  
Question by:hscdsb
  • 2
LVL 10

Accepted Solution

Spykair earned 100 total points
ID: 16851629
Go to the Database Expert -> Select your database -> "Add Command" -> En ter your SQL statement: Select Top 2 MyField1 from MyTable

Place this field on your report.

LVL 10

Expert Comment

ID: 16891896
Glad I could help.


Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1. Set up your parameter at the report level as usual, check the box Multi-value, and set the Data Type to String 2. Set the Stored Procedure Parameter to varchar(max)  --<---- This part here is the key to it's success Example:    @cst_key var…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month17 days, 12 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question