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!

Help with rtrim and ltrim

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
I am pulling data from an as400. everything was fine when the char size on the 400 was 1. the 400 admins changes the char size to three and it look like it's at the thrid position from the left. I combine three fields together to make one unique record..

Select * ,Convert(varchar(40),rtrim(DocNO) + left(PAGE,1) + ltrim(rtrim(LINE)) + '*' + rtrim(CONTNO) + '-'+ rtrim(SEQNO))
AS [DRUMNO]from openquery(AS400,'SELECT blaaaa


this is the field that wont trim

ltrim(rtrim(LINE))

does anyone know how I can force this to trim both r and l

thanks

 
never mind I was able to figure it out. I needed to perform the trim in the select statement after creating the unique number.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top