Results 1 to 5 of 5
  1. #1
    jgelpi16 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544

    Question Remove "-" from data


    I currently have incoming data that is either SSNs or FIDs (xxx-xx-xxxx or xx-xxxxxxx). The existing data (SSNs and FIDs) does not have the "-" in it, and thus I need to remove the "-" from the incoming data. Any suggestions?

  2. #2
    objNoob is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    21
    Use the Replace function.

    Replace function takes 3 parameters. The Haystack, The Needle, and Needle's replacement.

    Replace('999-99-999', '-', '') = 99999999


    You can use the replace function in a Query or VBA Code!

  3. #3
    jgelpi16 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544
    Thanks for your help. I actually ended up using the "Mid" function to extract the "xxx", "xx" and "xxxx" from the field, and then pushed it all back into one field without the "-".

  4. #4
    z1efuller1 is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2009
    Posts
    9
    You can also use
    SSN = substring(SSN,1,3)+substring(SSN,5,2)+substring(SS N,8,4)
    FEID = substring(FEID,1,2)+substring(FEID,4,7)

  5. #5
    jgelpi16 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544
    I like the substring method. That would have saved me some time! I will have to remember that one for the future. Thank you.

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

Similar Threads

  1. Replies: 21
    Last Post: 06-03-2009, 05:54 PM
  2. aSTR = Dir("C:\*.*") >> "Type Mismatch"
    By JGrant in forum Programming
    Replies: 1
    Last Post: 03-28-2009, 05:17 AM
  3. Export to .rtf of "104-" converts to "-655&qu
    By Sherri726 in forum Import/Export Data
    Replies: 0
    Last Post: 12-19-2006, 03:16 PM
  4. Replies: 2
    Last Post: 08-31-2006, 12:19 PM
  5. "Count" and "Countif" in Reports
    By JMantei in forum Reports
    Replies: 1
    Last Post: 06-20-2006, 02:20 PM

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