Finding a string in a field padded with spaces

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

Guest

How would I find a 5 character substring at the end of a variable length
string that is in a field that appears to be padded with spaces to the Right
because nothing shows up when I use the Right Function?
 
How would I find a 5 character substring at the end of a variable length
string that is in a field that appears to be padded with spaces to the Right
because nothing shows up when I use the Right Function?

Please post your expression and an example of the data that's not showing up.
It sounds like you're saying it's at the end of the string but it's not
showing up because it's not at the end of the string!

If you want to trim trailing blanks before using Right(), you can use the
Trim() function:

Right(Trim([fieldname]), 5)

will return ABCDE for "123ABCDE", " 345ABCDE ", or any string ending in
ABCDE followed by nothing but blanks.

John W. Vinson [MVP]
 
Back
Top