Results 1 to 2 of 2
  1. #1
    jjMcJoy is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    1

    Help with query

    I have a fieldA which is alphanumeric. I want to separate the fieldA into fieldB (leading alpha characters) and
    fieldC (numeric & end alpha).

    Below is a list of values in fieldA. Only the leading alpha characters need to be in fieldB. The alphas at the end
    should be in fieldC. There are spaces between the alpha and the number in some values. I have tried several
    things but can't get it to work. I want to do this in a query. I am not good with VB.

    Can someone please help me?


    ACCT201H
    AE 1010
    AE4120
    AECN100


    AECN399A
    LAW 501
    LAW 670G
    LAW602

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I don't see any pattern that can be used, so I think you're looking at a custom function that returns what you want. I'm thinking it loops the characters and uses IsNumeric to test each to find the first. Then the Left() or Mid() functions to return the desired value. I'd probably have an input parameter so the same function could return either section.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

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