August 15, 2007 at 12:09 pm
I have a field in my database
150 Summer St#450
It contains a CRLF after St and before #.
I need to extract this data in 2 pieces.
I need to select all the characters before the CRLF and all the
characters after the CRLF. Is there an easy way to do this?
August 15, 2007 at 12:17 pm
Look into using the LEFT() and CHARINDEX() functions to search for the results of CHAR(13) which resolves to a new line.
That should get you started.
August 15, 2007 at 12:25 pm
I've removed CR-LF characters via an update statement like so:
update
MyTable set FieldA = replace(replace(FieldA, char(13), ''), char(10), '')
where
charindex(char(10), FieldA) > 0 or charindex(char(13), FieldA) > 0
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply