How to trim a string in a table, text field?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xmanx
    New Member
    • Jan 2016
    • 4

    How to trim a string in a table, text field?

    Hi all. Please help.

    I have a field that is filled automatically from other resource but I want to trim the string to 8 characters from the right, how do I do that?

    Sample records, I want my table to show only the 8 characters from the right.
    000000000000000 0A1008182
    000000000000000 0A1012642

    Thank you in advance.
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    #2
    The Right() function returns the specified number of characters from right to left. I can't help with implementation without more information.

    Comment

    • calaxan
      New Member
      • Jan 2016
      • 12

      #3
      Right([TableName]![FieldName],8)

      Comment

      • xmanx
        New Member
        • Jan 2016
        • 4

        #4
        Thanks Seth.

        I am new to MS Access.

        I have a table the data is automatically loaded from other resource.

        The only useful characters are the 8 ones, 000000000000000 0A1008182, from the right.
        I need to trim them in order to create queries.

        I tried to trim them by using the right() expression in query but the trimmed data wouldn't match to my other table.

        Just wondering if I can directly trim the records in the table.

        I hope I am not confusing you any further.

        Thanks again.

        Comment

        • xmanx
          New Member
          • Jan 2016
          • 4

          #5
          Thanks Calaxan.

          Where should I enter this code?

          Sorry, I am new to MS Access.

          Comment

          • Seth Schrock
            Recognized Expert Specialist
            • Dec 2010
            • 2965

            #6
            What is in the "other table" you mention? What does it need to match to?

            Comment

            • xmanx
              New Member
              • Jan 2016
              • 4

              #7
              Actually problem solved, thanks for all your help.

              Comment

              Working...