Joyиal Ali
Joyиal Ali

Reputation: 89

SQL Remove Carriage return

The data I am extracting contains carraige returns, I am not able to export the data and do any analysis on it.

i.e

Select system_outcome , contact_list_name , agent_classification , timestamp_dtm , phone_number, agent_name
From call_stats_view
Where date(timestamp_dtm) BETWEEN '2016-11-10' AND '2016-11-10'

This should give me a

Answered, Contactlist1, Sale, 2016-11-10, 07777777777, John King

when i extract the information it all ends up on different lines any idea how i can get around this?

Upvotes: 3

Views: 21609

Answers (1)

Alexei - check Codidact
Alexei - check Codidact

Reputation: 23078

You should try something like the following:

SELECT REPLACE(REPLACE(yourColumn, CHAR(13), ''), CHAR(10), '')

to be certain that you remove all end of lines (CR & LF).

NOTE: you may considering replacing with ' ' (blank) if some useful information is separated by end of line only, otherwise you might get joined words.

Upvotes: 8

Related Questions