Results 1 to 3 of 3
  1. #1
    bstack10 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2016
    Posts
    2

    Formula Help

    Hi Guys,

    Very new to Access having an issue with a formula I have working in Excel correctly. But when I try to transfer it to Access its not working out.

    I have a set of phone numbers which vary in length I want to extract the numbers between the first two "-" see example below

    555-63738-939 (I would like to get "63738")
    55-00393930-0303 (I would like to get "00393930")




    Here is the excel version of the formula
    =MID(A1, FIND("-",A1)+1, FIND("-", A1, FIND("-", A1)+1)-FIND("-",A1)-1)

    In Access I have gotten the formula working up until the point that it grabs what is after the first "-" but when I try to add additional pieces to the formula that is where I am having problems

    Here is the Access formula that I have
    MidSectionPhoneNumber: Mid([Phone],(InStr([Phone],"-")+1))

  2. #2
    cyanidem's Avatar
    cyanidem is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2015
    Location
    Consett, UK
    Posts
    270
    Mid([Phone], (InStr([Phone], "-")) + 1, (InStrRev([Phone], "-")) - ((InStr([Phone], "-")) + 1))

  3. #3
    bstack10 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2016
    Posts
    2
    Quote Originally Posted by cyanidem View Post
    Mid([Phone], (InStr([Phone], "-")) + 1, (InStrRev([Phone], "-")) - ((InStr([Phone], "-")) + 1))

    Thanks very much!! does as is required

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

Similar Threads

  1. Replies: 19
    Last Post: 07-13-2015, 10:15 AM
  2. Replies: 41
    Last Post: 05-29-2015, 02:58 PM
  3. AND OR Formula
    By alecmat in forum Access
    Replies: 6
    Last Post: 03-10-2013, 10:31 AM
  4. Q: Help with a formula
    By TroxlSha in forum Access
    Replies: 3
    Last Post: 10-12-2012, 08:50 AM
  5. SQL Formula to Sum Itself
    By Scorpio11 in forum Access
    Replies: 1
    Last Post: 02-19-2011, 11:22 AM

Tags for this Thread

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