Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

LTRIM/RTRIM NOT TRIMMING Expand / Collapse
Author
Message
Posted Friday, December 12, 2003 9:24 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Saturday, June 8, 2013 9:13 AM
Points: 144, Visits: 275
I use ltrim and rtrim in select statement but the output is not trimmed. The variable are all of datatype varchar.

select ltrim(rtrim(org_name)),ltrim(rtrim(org_code)) from tableA

Does any one know what is happenning.
Thanks for your help.




Post #19161
Posted Friday, December 12, 2003 9:42 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, March 29, 2005 2:31 PM
Points: 393, Visits: 1
Can you post the results of
 
select TOP 1 '-' + ltrim(rtrim(org_name)) + '-'
from tableA?


Might also have some unprintable or CR/LF data embedded.
(Preview of this post removed the plus signs from each side of the LTRIM(...) )





Once you understand the BITs, all the pieces come together
Post #91071
Posted Friday, December 12, 2003 9:56 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Saturday, June 8, 2013 9:13 AM
Points: 144, Visits: 275
I think the problem in QA is setting the option to have column aligned in the result tab.

Thanks for your response.




Post #91072
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse