Results 1 to 4 of 4
  1. #1
    taimysho0 is offline Competent Performer
    Windows XP Access 2000
    Join Date
    Nov 2011
    Posts
    286

    How to Trim Values??


    Hello I have a phone column with values such as 9, 1234567890

    How do I format the column to only show 1234567890 for example?? Thanks!

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You could use the mid() function if your data is such that you will always want to view the string starting with the fourth character

    mid(phone,4)

  3. #3
    taimysho0 is offline Competent Performer
    Windows XP Access 2000
    Join Date
    Nov 2011
    Posts
    286
    i see! thanks. also, what if i want to trim off the last 4 digits?

  4. #4
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You can do this several different ways but it depends on the your data. If the data is of a consistent length and format, it would be pretty easy. For example, if you data is always like this: 9, 1234567890 and you want to always just show 12345, you can use the optional length parameter of the mid() function.

    mid(phone,4,5)

    The 4 defines the starting character whereas the 5 defines the length or # of characters to return. 12345 would be a 5 character long string.

    You also could nest the various functions. The ones I use the most are the mid(), instr(), left(), right(). You can find more about each of these text manipulation functions in the Help section of Access.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Trim vba
    By shexe in forum Access
    Replies: 5
    Last Post: 11-16-2011, 10:20 AM
  2. Trim value
    By dada in forum Programming
    Replies: 5
    Last Post: 09-02-2010, 11:01 PM
  3. Trim Function
    By ZMac in forum Reports
    Replies: 9
    Last Post: 08-30-2010, 07:36 AM
  4. Need Help with TRIM command
    By rbfarley in forum Reports
    Replies: 3
    Last Post: 01-08-2010, 02:03 PM
  5. Trim
    By JMantei in forum Forms
    Replies: 1
    Last Post: 06-20-2006, 02:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums