Reputation: 512
I have used a replace statement to I have @@@
after the name of the customer
MR@BOB@REED@@@@@@@@@@@@@@@@@@@@@@@
I now want to get rid of the @
after reed
.
I tried:
select RTRIM(Name2,'@')
But I get the error
The rtrim function requires 1 argument(s).
Upvotes: 1
Views: 3687
Reputation: 1059
select substring(Name2,0,charindex('@@',Name2)) from table
In above query, 'Name2' is the name of the column and table is the name of the 'table' containing that column.
Upvotes: 1
Reputation: 51504
RTRIM
removes trailing spaces.
You probably want LEFT
or SUBSTRING
eg
select left('@mr@bob@reed@@@@@@@', charindex('@@','@mr@bob@reed@@@@@@@'))
Upvotes: 2