Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Select first row of customer data Post Reply Post New Topic
Author Message
SNelson
Newbie
Newbie
Avatar

Joined: 20 Jan 2017
Online Status: Offline
Posts: 13
Quote SNelson Replybullet Topic: Select first row of customer data
    Posted: 06 Apr 2018 at 7:03am
Is there a way to select only the first row of customer data? Using the Select Expert? I have tried identifying the first row using the Running Total command. It works to give me an accurate count of rows for each customer but this field is not an option in the Select Expert. I have also tried creating a number variable from the value in the running total field but again can't use it in Select Expert. Thanks for any help!
SNelson
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 09 Apr 2018 at 4:32am
Nothing in the select expert would really work.  If you are grouping, you should be able to select the top 1 record (provided you have a summary for the group).  It is under Group Sort Expert.  I have only used a few times.

Other ways that might work for you.  Creating SQL (in a command) using the top x command.  Putting your details in the either a Group Header or Group Footer (depending on how you sort) and suppressing the details.
IP IP Logged
SNelson
Newbie
Newbie
Avatar

Joined: 20 Jan 2017
Online Status: Offline
Posts: 13
Quote SNelson Replybullet Posted: 10 Apr 2018 at 5:17am
Thanks for your suggestions. I have tried some things with grouping but have not tried the top 1 record so will look at that.

Re: SQL - I wondered this. I saw an SQL option in a different report that used a single record for a client based on the minimum value of a numeric field. Do you know of a minimum value command in SQL? If that's an option that might work too.

SNelson
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 10 Apr 2018 at 12:57pm
The aggregate for minimum in MS-SQL is MIN.  Of course there is also the TOP X in MS-SQL also.
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.