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

Strip the last 4 characters

Status
Not open for further replies.

IMAUser

Technical User
May 28, 2003
121
CH

Hi,

Is there a way to strip off the last few characters of a string. ( In my example, I need to stroip the last 4 characters)

So the example input strings are
2276680000EUR201020971
2338810000EUR201021861

And the output I need is
2276680000EUR20102
2338810000EUR20102

I couldnt see any option in the SUBSTR function.

Any ideas ?

Many Thanks.
 

Dont worry. Found the answer with regexp_replace :)
 
You can do it with SUBSTR using:

substr('2276680000EUR201020971', 1,
length('2276680000EUR201020971')-4)


For Oracle-related work, contact me through Linked-In.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top