Remove Carriage Return, Line Feed and Tab characters in T-SQL.
REPLACE(REPLACE(REPLACE(Field, CHAR(10), ''), CHAR(13), ''), CHAR(9), '')
Showing posts with label Carriage Return. Show all posts
Showing posts with label Carriage Return. Show all posts
Monday, 22 March 2010
Thursday, 22 October 2009
Condensing large character string and removing carriage returns - SSRS
***Update ***
Function created:
for condensing a large character string and removing any carriage returns (such as in a comments field).
Function shortcomment(byval commentstring as string, stringlength as integer) as string
if commentstring="" or isnothing(commentstring)
return commentstring
else
commentstring=replace(commentstring, chr(10)," ")
if commentstring.length >stringlengthcommentstring=left(commentstring, stringlength) & "....."
return commentstring
else
return commentstring
end if
end if
end function
to implement:
=code.shortcomment(Fields!comments.Value, 10)
where 10 is the condensed length
Function created:
for condensing a large character string and removing any carriage returns (such as in a comments field).
Function shortcomment(byval commentstring as string, stringlength as integer) as string
if commentstring="" or isnothing(commentstring)
return commentstring
else
commentstring=replace(commentstring, chr(10)," ")
if commentstring.length >stringlengthcommentstring=left(commentstring, stringlength) & "....."
return commentstring
else
return commentstring
end if
end if
end function
to implement:
=code.shortcomment(Fields!comments.Value, 10)
where 10 is the condensed length
Labels:
Carriage Return,
CHR(10),
Condensing,
Function,
Left,
Length,
remove,
Replace,
SSRS
Subscribe to:
Posts (Atom)