last 3 charecters [message #301980] |
Fri, 22 February 2008 10:39  |
Cathy2008
Messages: 9 Registered: February 2008
|
Junior Member |
|
|
I need to get the last 3 charecters from a charecter field and the data is not always have same length. How can i get it.
Thanks,
Cathy
|
|
|
|
|
|
Re: last 3 charecters [message #301987 is a reply to message #301980] |
Fri, 22 February 2008 10:59   |
Cathy2008
Messages: 9 Registered: February 2008
|
Junior Member |
|
|
I can use the substr function, but the string in the coulumn is not always have the same lengh.
for e.g., the data in the table column looks like below
ID
------------
PEB2005SEB000
XYPZ247200MEBRS
BSD400NYPXPR5780
.
.
.
appreciate your help.
|
|
|
|
|
|
Re: last 3 charecters [message #301994 is a reply to message #301992] |
Fri, 22 February 2008 11:08  |
pablolee
Messages: 2882 Registered: May 2007 Location: Scotland
|
Senior Member |
|
|
Do NOT use the reverse function. As has already been said, look at Michel's link. Use a negative number as the 2nd parameter. Job done.
|
|
|