Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1051
  • Last Modified:

sql 2005 replace carriage return statement

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
Steve_Lockhart
Asked:
Steve_Lockhart
  • 2
1 Solution
 
Patrick MatthewsCommented:
SELECT REPLACE(REPLACE(mm2po.sdesc, CHAR(10), ''), CHAR(13), '') AS Clean
FROM SomeTable
0
 
Steve_LockhartAuthor Commented:
Worked
0
 
Patrick MatthewsCommented:
Steve_Lockhart,

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

Regards,

Patrick
0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now