C G
asked on
LTRIM(LTRIM.....
Hi Experts,
I am using the derived column transformation for my package and i have a column that has the name of a city, state and company name.. 'New York, NY-The First Bank'. My goal is to grab only the company name, and put it in another column. I am using the LTRIM Expression
LTRIM(SUBSTRING([Customer Name],FINDSTRING([Customer Name],"-",1),LEN([Customer Name])))
This is grabbing the company name along with the '-'. Any suggestions on how i can get rid of the '-', I have tried to use 2 LTRIM's but it gives me the same result.
Thank you.. :)
I am using the derived column transformation for my package and i have a column that has the name of a city, state and company name.. 'New York, NY-The First Bank'. My goal is to grab only the company name, and put it in another column. I am using the LTRIM Expression
LTRIM(SUBSTRING([Customer Name],FINDSTRING([Customer
This is grabbing the company name along with the '-'. Any suggestions on how i can get rid of the '-', I have tried to use 2 LTRIM's but it gives me the same result.
Thank you.. :)
LTRIM(RTRIM(SUBSTRING([Cus tomer Name],CHARINDEX('-', [Customer Name]) - 1,8000)))
ASKER
Getting error message, it does not recognize the CHARINDEX..
Then you must not be using SQL Server.
I guess go back to FINDSTRING, as in your original post, just add the "- 1" after the SUBSTRING:
LTRIM(SUBSTRING([Customer Name],FINDSTRING([Customer Name],"-",1) - 1,LEN([Customer Name])))
I guess go back to FINDSTRING, as in your original post, just add the "- 1" after the SUBSTRING:
LTRIM(SUBSTRING([Customer Name],FINDSTRING([Customer
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
+1 did the trick.. Thank you. :)