Access Substrings

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bob1963
    New Member
    • Aug 2007
    • 1

    Access Substrings

    I am trying to chop off the 011 in all of my phone numbers in my database. Can someone show me how this is done using a Access Substring. Example

    0119546521234

    I want it to only show 9546521234.
    Any help would be appreciated as I am new to Access.

    Bob
  • epots9
    Recognized Expert Top Contributor
    • May 2007
    • 1352

    #2
    Originally posted by Bob1963
    I am trying to chop off the 011 in all of my phone numbers in my database. Can someone show me how this is done using a Access Substring. Example

    0119546521234

    I want it to only show 9546521234.
    Any help would be appreciated as I am new to Access.

    Bob
    Hi Bob1963 welcome to TSDN,

    try this:
    In Access, the Mid function extracts a substring from a string (starting at any position).

    The syntax for the Mid function is:

    Mid ( text, start_position, number_of_chara cters )

    Text is the string that you wish to extract from.

    Start_position indicates the position in the string that you will begin extracting from. The first position in the string is 1.

    Number_of_chara cters indicates the number of characters that you wish to extract. If you omit this parameter, the Mid function will return all characters after the start_position.

    For example:

    Mid ("Tech on the Net", 1, 4) would return "Tech"
    Mid ("Alphabet", 5, 2) would return "ab"
    Mid ("Alphabet", 5) would return "abet"
    Next time post in the access forums to get faster results.

    Comment

    • pbmods
      Recognized Expert Expert
      • Apr 2007
      • 5821

      #3
      ... in the meantime, I'll go ahead and move it to the Access forum.

      Comment

      Working...