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

How to get last 2 characters out of a string 1

Status
Not open for further replies.

maggielady

Technical User
Jan 3, 2003
60
0
0
US
I have a field called membernum. It has numbers such as 101, 2801, 11202 and so on. I need to break that apart. I need the last two characters in their own field and the remaining to stay in the current field. Could anyone please help me, I'm having a brain fried day.
 
Assuming the field is character:


REPLACE ALL NewField WITH RIGHT(ALLTRIM(OldField),2)
REPLACE ALL OldField WITH LEFT(ALLTRIM(OldField), LEN(ALLTRIM(OldField))-2)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top