Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    65

    Unanswered: Function to get substring

    Hi!

    What function should I use to get a substring out of a larger string? I have a phone number field that was entered as a 10 -digit number. I want to re-format this field to look like (xxx) yyy-zzzz.

    I'm going to use an update query to do this but I don't know the right function to use.

  2. #2
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    574
    to get a sub string use left, mid or right functions
    to format a 10 digit number as a phone number use the format property so the extra characters are not stored in the database for no reason

  3. #3
    Join Date
    Oct 2003
    Posts
    311

    Re: Function to get substring

    Originally posted by Jigsatics
    Hi!

    What function should I use to get a substring out of a larger string? I have a phone number field that was entered as a 10 -digit number. I want to re-format this field to look like (xxx) yyy-zzzz.

    I'm going to use an update query to do this but I don't know the right function to use.
    Dim n
    n = 1234567890
    n = "(" & Left(n, 3) & ") " & Mid(n, 4, 3) & "-" & Right(n, 4)
    MsgBox n

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •