Results 1 to 2 of 2
  1. #1
    Jerseynjphillypa is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Apr 2012
    Posts
    83

    How to eliminate the text after and before the dash

    How would I write the query in the Criteria field to eliminate the text before the dash and then after the dash?



    Since I am getting data like
    US - Apple
    FRANCE - Dell


    So for the field Location, I only want to see US or FRANCE

    And in the field Item, I only want to see Apple or Dell

  2. #2
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,071
    In one column you would use Left([fieldname],Instr(1,[fieldname],"-")-1) In another column use Right([fieldname],Len([fieldname])-instr(1,[fieldname],"-"))

    although you may want to lookup the parameter order for Instr I think it's (starting position,string to look in, string to look for) but I could be wrong. I don't use it enough to be 100% sure.

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

Similar Threads

  1. Replies: 1
    Last Post: 01-11-2012, 03:07 PM
  2. Dash Board.
    By cap.zadi in forum Forms
    Replies: 1
    Last Post: 09-14-2011, 08:10 AM
  3. Eliminate dead code
    By thekruser in forum Programming
    Replies: 7
    Last Post: 09-15-2010, 09:52 AM
  4. I need to remove a dash from a number string.
    By catguy in forum Programming
    Replies: 3
    Last Post: 02-18-2010, 02:56 PM
  5. Insert Dash between set of Numbers
    By Jhankish in forum Programming
    Replies: 2
    Last Post: 04-19-2007, 08:02 AM

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