Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: How to pull first line of data from multiple rows Post Reply Post New Topic
Author Message
SNelson
Newbie
Newbie
Avatar

Joined: 20 Jan 2017
Online Status: Offline
Posts: 13
Quote SNelson Replybullet Topic: How to pull first line of data from multiple rows
    Posted: 24 Oct 2017 at 8:39am
I need to select the first record for each 'customer' in my database. There is a field that has the row/record number for each customer but this number doesn't always start with '1'. Is there a way to select the record based on the minimum value of this field? Or another way?

In the select expert the only options are less than, greater than, equal to, etc. This doesn't work b/c the minimum value isn't the same for each customer.

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: 24 Oct 2017 at 11:23am
Sort of.  You can group by 'customer' and display the information in the group header (suppress the detail).  Not sure what will determine the first row though for each customer.
IP IP Logged
SNelson
Newbie
Newbie
Avatar

Joined: 20 Jan 2017
Online Status: Offline
Posts: 13
Quote SNelson Replybullet Posted: 25 Oct 2017 at 9:58am
I've also created a running total, which does let me number by customer beginning from 1, but I can't use that in the select expert.

I wondered if an SQL query would work instead. I've seen something similar using this idea:
( select
      min(case...)
)
SNelson
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.