0

I'm trying to remove various characters from a value to only get/display the numeric characters. I can get results such as

value1: 162246xx
value2: =W035268
value3: +034567
value4: =<E04569

but only am interested and getting: value1: 162246 value2: 035268 value3: 034567 value4: 04569

What type of query can I run to retrieve all the values from column X excluding non numerical characters within the value? Thank you.

  • 3
    Related - [TSQL Replace all non a-z/A-Z characters with an empty string](http://stackoverflow.com/questions/2374594/tsql-replace-all-non-a-z-a-z-characters-with-an-empty-string) – alroc Jan 07 '13 at 18:55
  • Though it would be better if I mentioned that I'm querying the table and not attempting to modify the way the data is stored. I just want to retrieve the data and get results without the non numeric characters. thanks – Didier Seburyamo Jan 07 '13 at 20:42
  • 1
    So don't run the `UPDATE` statement - perform the `replace` within your `SELECT` so that the values that come out are stripped of the non-numeric characters. – alroc Jan 07 '13 at 21:03
  • This page might help as well: http://stackoverflow.com/questions/52315/t-sql-trim-nbsp-and-other-non-alphanumeric-characters – JOpuckman Jan 07 '13 at 21:49
  • So if I have the following: – Didier Seburyamo Jan 08 '13 at 13:53
  • "Select h.value from hobservation h where h.findingAbbr = a_findingB" how do I add the function to make sure h.value displays only the numeric characters? All this is new to me and I’m not understanding the links provided to me. Thanks in advance. – Didier Seburyamo Jan 08 '13 at 14:02

0 Answers0