Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 View Help

Author  Topic 

jim_jim
Constraint Violating Yak Guru

306 Posts

Posted - 2012-01-20 : 11:43:27
I have a table Named Customer_Distribution in which we store all the reepient information based on a request submitted by the customer.
Maximum number of recepients for a request is 8.So if a customer submits a request with 4 recepients the Customer_Distribution table will have 4 records inserted for the request

I would like help to create a view to make the 2 records show in one line rather than 2 differant lines

EXample data in the table

ReqNo recepientdesc recepientname recepientemail
1 R Abc abc@yahoo.com
1 U xyz xyz@gmail.com


The View should have the data in the below format

ReqNo desc1 name1 email1 desc2 name2 email2
1 R Abc abc@yahoo.com U Xyz xyz@gmail.com


Thanks
Jim

X002548
Not Just a Number

15586 Posts

Posted - 2012-01-20 : 13:18:48
isn't this a presentation issue?

and what if they had 8?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

jim_jim
Constraint Violating Yak Guru

306 Posts

Posted - 2012-01-20 : 16:49:54

there is always a possibility to have 8 recepients.I want to create a view with feilds from differant tables and i was strugling how to convert this information into a single row
quote:
Originally posted by X002548

isn't this a presentation issue?

and what if they had 8?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/




Go to Top of Page

jim_jim
Constraint Violating Yak Guru

306 Posts

Posted - 2012-01-24 : 08:34:07
Is there something wrong with my post.Need help to create this view using which i will have to create another view to get information about an entire request in a single row rather than having multiple rows
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-01-24 : 16:16:13
Sorry been busy celebrating

my point is..if you are going to display the data, why not use the front end to just display it the way that you want?

What is your application code written in?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

jim_jim
Constraint Violating Yak Guru

306 Posts

Posted - 2012-01-25 : 08:10:08
our front end application is written in asp.
we have someone in our team who is trying to use the data in an access application.

it is not for displaying data but to be able to retreive the entire data for a request in a single row rather than have multiple rows.

Thanks
Go to Top of Page
   

- Advertisement -