SQL or Crystal repors to enable single row record

I will describe the issue as best I can!

I am not able to change the DB structure as it is a commercial DB.

Scenario: I have 2 tables, orders and consultants as follows

Orders                                        
orderID
1001
1002
1003
etc

Consultants
person        role
person1      sales
person2      Account manager
person3      sales
person4      Account manager
etc


These tables are linked, the issue is when running the query i get the following

orderID             person      
1001                  person1
1001                  person2      
1002                  person3
1002                  person4

What I need to achieve is:

orderID          Sales                 Account manager
1001               Person1            Person2
1002               person3            person4      


Any pointers or help would be greatly appreciated

Many thanks in advance,

Keith.
kaleesAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
Insert, CrossTab.
Row: Order ID
Column: Role
Summarized Field: MAX of Person
kaleesAuthor Commented:
Hi Many thanks for your prompt reply.

While that goes some way to the perfect result when exported to csv it is not all in a single row so is not easy to work with as in reality I have more than just the orderID .

sorry for causing any confusion.

Do you have any further suggestion for addressing this?

Regards

Keith
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
In that case, you probably need to create a formula for each possible column, group on Order ID, and arrange the formulas in the Group Footer.  Suppress the detail.
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
Just to clarify, the formula for Account Manager would be something like:
IF Role = Account_Manager Then Person Else ""
Then, in the group footer for ORDER ID you would show the MAX of that formula per Order ID.
Repeat as separate columns for each Role.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.