Function to manipulate text string

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a text string of varying length. I simply want to lop off the last 4 characters, and leave the remaining characters. Is there a function(s) that will do that for me?

Thanks in advance
 
Left(MyString, Len(MyString) - 4)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Kirk P. said:
I have a text string of varying length. I simply want to lop off the last
4 characters, and leave the remaining characters. Is there a function(s)
that will do that for me?
 
Works fine for me. From the Immediate window:

?Left("LU06993.2099", Len("LU06993.2099")-4)
LU06993.

Is it possible that there are blanks at the end of the string? Try

Left(MyString, Len(RTrim(MyString)) - 4)


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Kirk P. said:
Your suggestion worked fine for all my text fields that contain numeric
characters, but when I apply the funtion to a field that contains data such
as this:
 
You are correct - there are blanks at the end of the string. Now your function works perfectly.

Thanks!
 
Back
Top