Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Sorting on Multiple Fields Post Reply Post New Topic
Author Message
Frank in VA
Groupie
Groupie
Avatar

Joined: 15 Nov 2007
Location: United States
Online Status: Offline
Posts: 46
Quote Frank in VA Replybullet Topic: Sorting on Multiple Fields
     Posted: 09 Nov 2009 at 1:05pm
Hi All,
I have what I hope is an easy question for someone.  I need to sort my data by last_name, then first_name.  I tried concatenating the two fields (last_name & first_name) but this does not work too well with last names that are very similar.  I currently have this code in place in a formula field, which I then have set up as a group:
 
If {?ReportType} = 'LASTNAME' THEN
  {CUSTOMER.LAST_NAME}
 
I tried to add the first_name field to the above statement but did not get the correct results.
 
Is there a way to modify this statement to include the first name as a secondary sort?
 
Thanks!
Frank
Frank
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Nov 2009 at 1:26pm

A little confused by your question and use of a parameter here?

You should be able to just use the Record Sort Expert and make the Lname the primary and the Fname the secondary sort.
Are you trying to do some grouping that is making it sort on a different field first or some other reason for the param?


Edited by DBlank - 09 Nov 2009 at 1:27pm
IP IP Logged
Frank in VA
Groupie
Groupie
Avatar

Joined: 15 Nov 2007
Location: United States
Online Status: Offline
Posts: 46
Quote Frank in VA Replybullet Posted: 09 Nov 2009 at 1:51pm
Thanks for your quick response.  You suggestion has solved my problem.  My report currently has 3 sort options, last name,  customer number and zip code.  The main sort was last_name and the subsort was using zip_code.  I just changed the subsort to first_name and it looks great.
 
Once again, thanks for your help with Crystal Reports.  Have a great week!
 
Frank
Frank
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