Split into 2 lines

I have this SQL Data texts:

"Approved By: John Doe @ 6/1/2011 10:37:41 AM " 

and I want to split into 2 lines

"Approved By:
                     

               John Doe @ 6/1/2011 10:37:41 AM"



Thanks!
JaimeJegoniaAsked:
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.

santhimurthydCommented:
Do you want this to be in Two rows else while displaying in Browser this needs to be in two lines

Two line while displying in IE Browser
select replace('Approved By: John Doe @ 6/1/2011 10:37:41 AM' , 'By:' , 'By:<br/>')

Two different rows

select substring('Approved By: John Doe @ 6/1/2011 10:37:41 AM' , 0 , charIndex('By:' , 'Approved By: John Doe @ 6/1/2011 10:37:41 AM') + 3)
Union ALL
select substring('Approved By: John Doe @ 6/1/2011 10:37:41 AM' ,charIndex('By:' , 'Approved By: John Doe @ 6/1/2011 10:37:41 AM') + 3
, len('Approved By: John Doe @ 6/1/2011 10:37:41 AM')-(charIndex('By:' , 'Approved By: John Doe @ 6/1/2011 10:37:41 AM') + 3))

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
keyuCommented:
Try this

SELECT REPLACE('Approved By: John Doe @ 6/1/2011 10:37:41 AM ','By:','By:'+char(13));
0
JaimeJegoniaAuthor Commented:
I'm not sure how to use your suggestions:

You need to take note that my sample data is to be taken from SQL DB field name "dbo.PO.Approval" with "Approved By:" appears to be constant, and the rests are dynamic.

Thanks.


0
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

keyuCommented:
select Replace(Fieldname,'By:','By:'+char(13)) from tablename

here fieldname is your fieldname  and tablename is your tablename
 
0
JaimeJegoniaAuthor Commented:
keyu,

I tried your suggestions but did not work.


 Thanks for the try.
0
JaimeJegoniaAuthor Commented:
I preferred you 1st suggestion.

Thanks!
0
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.