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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert CHAR to numeric ?

Status
Not open for further replies.

StevePB

Technical User
Dec 6, 2001
92
GB
Hi, can anyone tell me if it is possible to convert a character field to numeric when I don't know what the character part is going to look like ?

Maybe I'm expecting too much, but I'd like to convert the data in a column formatted as character, to numeric by simply dropping all the alpha characters.

E.g.1 - if the field contains: i-123456
Convert to numeric data type containing: 123456

E.g.2 - if the field contains: inv-789012
Convert to numeric data type containing: 789012

And so on...

Any help greatly appreciated.
 
The OCONV(DATA,"MCN") should strip off all non-numeric characters.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top