Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

split a sql field based on carriage return

Status
Not open for further replies.

Tonyvee73

Technical User
Jul 4, 2018
10
0
0
GB
Hi All
My first post here, hope someone can help me?
I have a table named SL_ADDRESSES and a field in there named (AD_ADDRESS. This has 4 lines or so of data all with carriage returns at the end of each line. When i select the AD_ADDRESS field all data is in one field. Is there a way to separate this into separate fields based on lines of data before the carriage return? Really am stuck.
Thanks
 

From thread222-1808343:
"sorry, i mean how do i get into my SELECT query in sql?"

What I would like to know:
Show the example of the data you have, and
show what you want it to look like as the outcome.

So, if your data looks like:
[pre]
AD_ADDRESS

----------------
123 Main Street
Some City, CA
90210
----------------
876 Center Ave
Springfield
US 12345
----------------
[/pre]
The output would be: ???

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top