Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Display and Sort 2 fields in one column Post Reply Post New Topic
Author Message
sanfran
Newbie
Newbie


Joined: 03 Oct 2011
Online Status: Offline
Posts: 2
Quote sanfran Replybullet Topic: Display and Sort 2 fields in one column
     Posted: 03 Oct 2011 at 5:39am
I've been struggling with this for a while.  Can anyone help me with this please?
 
My customer database has two contact names (contact1 and contact2).  I need to produce a listing of all my contacts in one column, sorted alphabetically.
For example:
Customer: ABC Co
Contact1: Sally
Contact2: Adam
 
Customer: XYZ Co
Contact 1: David
Contact 2: Jane
 
Objective:
 
Name        Co.
------------------------
Adam         ABC Co
David         XYZ Co
Jane          XYZ
Sally           ABC
 
 
Thank you.
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Oct 2011 at 6:10am

create a command (or a view or stored proc in sql) unioning the table to itself then use this as your source.

Example:
select table.contact1, table.customer
from table
union
select table_1.contact2, table_1.customer
from table_1


Edited by DBlank - 03 Oct 2011 at 6:11am
IP IP Logged
sanfran
Newbie
Newbie


Joined: 03 Oct 2011
Online Status: Offline
Posts: 2
Quote sanfran Replybullet Posted: 03 Oct 2011 at 2:47pm
Thank you for your quick reply.  I will try that.  Thanks again.
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