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

  • Thread starter Adarsh Ganeriwalla
  • 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.
 
B

Brendan Reynolds

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top