Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Atlanta, Georgia, USA
    Posts
    274
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Parse Email String (Access 2K/XP)

    I'm trying to separate a field [Responder] into 2 fields. Brand and name.
    The format of the emails is:
    anyaddress@anydomain(pontiac_john_doe).com
    anyaddress@anydomain(chevy_john_smith).com
    I got the brand to work by using:
    Mid([responder],InStr([Responder],"(")+1,(InStr([responder],"_")-1)-(InStr([Responder],"(")))
    I don't see how to use instr to find the second "_" in the string to separate the name.
    Can someone point me in the right direction.
    Thanks,
    Scott

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Parse Email String (Access 2K/XP)

    To return "john":

    Mid([Responder], InStr([Responder], "_") + 1, InStr(InStr([Responder], "_") + 1, [Responder], "_") - InStr([Responder], "_") - 1)

    To return "doe" or "smith":

    Mid([Responder], InStr(InStr([Responder], "_") + 1, [Responder], "_") + 1, InStr(InStr(InStr([Responder], "_") + 1, [Responder], "_") + 1, [Responder], ")") - InStr(InStr([Responder], "_") + 1, [Responder], "_") - 1)

    <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Atlanta, Georgia, USA
    Posts
    274
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Parse Email String (Access 2K/XP)

    Hans,
    Thanks, I never thought to nest the Instr together like that. That's what I get for trying to use the help files.
    Scott

Posting Permissions

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