Solved

sql 2005 replace carriage return statement

Posted on 2008-10-10
3
1,034 Views
Last Modified: 2011-05-06
Do you happen to know how to remove a Carriage Return and or line feeds from a field when selecting for reports.

In the mm2po.sdesc field some of our users have entered the following:

FORT SHAFTER

Cancelled PO.  Processed invoice through A/P.

When trying to use this in a report it really messes things up. I would like to pull it to one line instead of having 2 CRs that puts it on different lines.

I have tried the select replace(mm2po.sdesc,ascii char(13),) but that did not seem to solve the problem.

Any ideas you have would be very apprecaiated.
0
Comment
Question by:Steve_Lockhart
  • 2
3 Comments
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 22687835
SELECT REPLACE(REPLACE(mm2po.sdesc, CHAR(10), ''), CHAR(13), '') AS Clean
FROM SomeTable
0
 

Author Comment

by:Steve_Lockhart
ID: 22689202
Worked
0
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 500 total points
ID: 22690308
Steve_Lockhart,

Glad to help.  Please don't forget to close your question :)

Regards,

Patrick
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question