Trimming blank data [message #143698] |
Fri, 21 October 2005 09:03 |
orahugo
Messages: 32 Registered: October 2005 Location: England
|
Member |
|
|
Hello,
Assume I have the following values in different records of field; 'ROTHER, 'JONES', 'CAMERON'
Following that data there is several spaces (don't ask, it's company policy).
Is it possible to trim the field down so that the blank spaces aren't shown? I'd assume you can use ltrim, but that wouldn't work as the data lengths change.
Is it possible to adapt a piece of data to remove all instances of a certain character? In this case it'd be the space.
Many thanks.
|
|
|
Re: Trimming blank data [message #143738 is a reply to message #143698] |
Fri, 21 October 2005 14:45 |
Steve Corey
Messages: 336 Registered: February 2005 Location: RI
|
Senior Member |
|
|
Yes.
Dependant on the version of SQL you are using, the REPLACE function works nicely.
select
REPLACE('Hi My Name Is', ' ', '')
from
DUAL
will yield
'HiMyNameIs'
HTH,
Steve
edit - you can use a column instead of the literal 'Hi My Name Is' in the call to the REPLACE function.
[Updated on: Fri, 21 October 2005 14:46] Report message to a moderator
|
|
|
Re: Trimming blank data [message #143924 is a reply to message #143738] |
Mon, 24 October 2005 03:53 |
orahugo
Messages: 32 Registered: October 2005 Location: England
|
Member |
|
|
Thanks, that works great at taking out the spaces. However I still appear to have my previous problem.
It's odd, because I've got a table report that has two columns. One column's data is pretty short and the other is long, so I set the vertical elasticity for that column as variable.
So, obviously, the rows that need to stretch down, stretch down. But for some reasons the rows that don't need to stretch down still stretch down.
I thought it may have been due to spaces in the data, hence why I asked this question, but it doesn't appear to be.
Any ideas?
|
|
|