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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remove leading spaces

Status
Not open for further replies.
Jun 27, 2001
837
US
I have some data where the user hit a carriage return at the beginning where data looks like

T1 D X365D

I need it to look like

T1 D X365D

How can I remove just the leading char(13) spaces?
 
Give this a try:
Code:
LTRIM(REPLACE(field1, char(13),''))

~Brian
 
the ltrim with the replace only removes the first space, I need all leading spaces replaced.
 
you just need to use the LTRIM command.
Something like this

LTRIM(@varname)

This eliminates all leading spaces.
 
the REPLACE(field1, char(13),'') removes only the first
space
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top