How do I remove the trailing & leading characters from a SQL column

  • Thread starter Thread starter Adarsh Ganeriwalla
  • Start date Start date
A

Adarsh Ganeriwalla

Hi,
Well data in a column in one of the tables I need to retrieve records
from is stored in the format:

$xyz$
$abcde$
$pqrstuvw$

Can anyone help me out how to remove this '$' character from the
column both leading and trailing ones.
 
This is untested air-SQL, I think I got it right but watch for potential
typos on my part ...

SELECT Replace([YourField],"$","") AS YourAlias FROM YourTable

.... or if you want to permanently change the stored data ...

UPDATE YourTable SET YourField = Replace([YourField], "$", "") WHERE
YourField IS NOT NULL
 
Back
Top