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 derfloh 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.
Joined
Jun 27, 2001
Messages
837
Location
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.
 
Try just replace ?

REPLACE(field1, char(13),'')


Dickie Bird ((:-)))
 
you just need to use the LTRIM command.
Something like this

LTRIM(@varname)

This eliminates all leading spaces.
 
It's not spaces. though, it's ascii 13

Dickie Bird ((:-)))
 
the REPLACE(field1, char(13),'') removes only the first
space
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top