Results 1 to 4 of 4
  1. #1
    swindmiller is offline Novice
    Windows XP Access 2002
    Join Date
    Feb 2010
    Posts
    2

    Deleting certain data

    I am not even sure what I need but I have a table that has data that looks like: Data1_Data2.Data3 in a certain field. I am importing this data from another DB and want to remove everything after the "_".



    Would this be a query and how would I do it?


    Thanks,
    Scott

  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,521
    You can use the Left() function along with the InStr() function to find the position of the underscore. You can either display the revised data that way in a query/form/report, or actually change the stored data with an UPDATE query. Have a look at those in help and see how it goes. Post back if you get stuck.

  3. #3
    swindmiller is offline Novice
    Windows XP Access 2002
    Join Date
    Feb 2010
    Posts
    2
    Thanks for the push in the right direction.

    The field name I am using is: Home Directory_Volume

    So I tried:
    Left([Home Directory_Volume],(InStr(1,[Home Directory_Volume],"_")-1)) to try to get everything before the _and I get a Data Type Mismatch.

    What am I doing wrong.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I'm not sure. Just did a brief test and it worked as expected. Can you post the db?

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

Similar Threads

  1. Deleting Duplicates
    By TundraMonkey in forum Queries
    Replies: 4
    Last Post: 09-08-2009, 07:13 AM
  2. Delete Query Deleting Too Much
    By TundraMonkey in forum Queries
    Replies: 6
    Last Post: 06-30-2009, 02:39 PM
  3. Error when deleting a record
    By access in forum Forms
    Replies: 5
    Last Post: 06-15-2009, 12:33 PM
  4. Problem Deleting Records with ADO
    By bdicasa in forum Programming
    Replies: 0
    Last Post: 08-21-2008, 09:27 AM
  5. Deleting Spaces
    By grgerhard in forum Import/Export Data
    Replies: 2
    Last Post: 04-30-2006, 06:42 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