Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove Hyphen from Field in MSSQL2005

Status
Not open for further replies.

only412c

MIS
Jan 29, 2003
32
US
I am trying to remove Hyphen and only report the number from field, how best to do so?
Example
Loinc_Cd Result needed
4548-4 45484
13457-7 134577
718-7 7187
2857-1 28571
2514-8 25148

Thanks in advance for you help.
 
You could just use the REPLACE function in SQL. This will just replace it with an empty string but you can do it however you wish.
Code:
SELECT REPLACE(Loinc_Cd, '-', '')

------------------------------------------------------------------------------------------------------------------------
Reason and free inquiry are the only effectual agents against error; they are the natural enemies of error and of error only.

Thomas Jefferson

 
Thank for all and quick response. Sorry to bother, should have known better to use replace.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top