Results 1 to 4 of 4
  1. #1
    pjordan@drcog.org is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Dec 2011
    Location
    Denver, CO
    Posts
    71

    Rearranging Text in Text Field

    Ok so I have a text field called Locatio. The format is something like this:

    ARAPAHOE RD & 18300 E
    CALEY CIR & 9663 E


    etc.

    What I want to do is find a way to take all the text including the & and place it at the very front so that the results are:

    & 18300 E ARAPAHOE RD
    & 9663 E CALEY CIR

    Which after that I can do a search/replace and remove the & to have a valid address.

    Is there an easy way to do this in a query?

    Thanks

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    Code:
    mid([Locatio],instr([Locatio],"&")) & " " & left([Locatio],instr([Locatio],"&")-1)

  3. #3
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    SELECT Mid([Locatio],InStr(1,[Locatio],"&")) & " " & TRIM(Mid([Locatio],1,InStr(1,[Locatio],"&") - 1))
    FROM TABLENAME;

  4. #4
    pjordan@drcog.org is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Dec 2011
    Location
    Denver, CO
    Posts
    71
    Thanks guys

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

Similar Threads

  1. Replies: 9
    Last Post: 04-18-2014, 08:51 PM
  2. Replies: 1
    Last Post: 03-27-2014, 06:42 AM
  3. Replies: 4
    Last Post: 10-15-2012, 11:38 AM
  4. Replies: 12
    Last Post: 06-04-2012, 10:55 AM
  5. Replies: 2
    Last Post: 05-05-2010, 02:52 PM

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