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!

Stripping Figures from a field.

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello all,

I was wondering if it was possible to take the first two digits of a figure out of a files.

For example: 359999

I would like the figure to be 9999. Is their any way of going about this.

Cheers
 
Ok Ben Try This One

Select OldNumber, substr(to_char(OldNumber),3) NewNumber
From YourTable
Where Len(to_char(OldNumber))>2;

You don't need the 'Where' clause if you are sure the OldNumber column has data with more than 2 digits.

Check the results OldNumber & NewNumber with the above 'Select' first, before doing any updates !!

Have Fun !!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top