SQL O/p Formatiing in sql server 2008R2

I have the following op.

                   Testname-Units                                       ADT - Value
BLOOD GLUCOSE (Fasting)(mg/dL)                               11/06/2014  05:49 - 115
BLOOD GLUCOSE (Fasting)(mg/dL)                               12/06/2014  06:06 - 120
BLOOD GLUCOSE (Fasting)(mg/dL)                                13/06/2014  06:40 - 163
BLOOD GLUCOSE (Fasting)(mg/dL)                                15/06/2014  06:52 - 93
BLOOD GLUCOSE (Fasting)(mg/dL)                                 16/06/2014  06:32 - 103

I want it to appear as below

Testname - Units                                                   ADT : Value
BLOOD GLUCOSE (Fasting)(mg/dL)                      11/06/2014  05:49 -115 |12/06/2014  06:06 - 120|                                            
                                                                                13/06/2014  06:40 -  163|15/06/2014  06:52 - 93| 16/06/2014  06:32 - 103 |

Like this for a given patient the  number of tests may vary and for given test, no of datetime can vary depending on the duration of patient stay in the hospital


After pre - defined | delimiter the column content should wrap to next line.

This is required for saving printing stationary   (Printout is taken in A4 size sheet)

I request an expert help in this regard at the earliest.

Thanks in advance
venkataramanaiahsrAsked:
Who is Participating?
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.

Russell FoxDatabase DeveloperCommented:
You can use the FOR XML construct in this post to concatenate multiple rows into a single string, although a better long-term solution may be to create an SSRS report to do this stuff for you. That will give you much better control over the formatting as printed.
0

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
Microsoft SQL Server 2008

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.