Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Return only first 10 results of query Post Reply Post New Topic
Author Message
NCBeach4Me
Newbie
Newbie
Avatar

Joined: 28 Sep 2009
Location: United States
Online Status: Offline
Posts: 15
Quote NCBeach4Me Replybullet Topic: Return only first 10 results of query
     Posted: 28 Sep 2009 at 5:45am
Hi.  I'm a Crystal beginner.
 
How do I return just the top 10 results of a query in my report?
 
Thanks so much!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 28 Sep 2009 at 6:16am

2 possible answers. 1) if you get the data via a stored proc, just change the final select to Select Top 10 (field list) from ... OR 2) look in the Crystal Help under 'Top N'. 

I'm sure that DBlank will give a more complete answer...I think he has done this type of report, my company tends to want it all.
 
HTH
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Sep 2009 at 7:22am
To use a top N (10) for groups you need a group and a summary of that group (which defines the top values). The summary must be able to have been created using the Insert Summary function. (E.g. Group by Vendor and a sum of sales by vendor).
If there is a group and a summary the Group Sort Expert will be activated. Once active change it to a group sort of "Top N" and change N to 10. Choose if you want to include others as or not.
 
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum