Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Separating Info (2002)

    Hi,

    I'm creating an error report for a database that imports info. When the info imports incorrectly it will be in the format of
    Name #13755_38487. I need it to simply show the Name#13755 (or whatever number is being imported) and leave off the _38487. The numbers at the end are the text format of the date being imported, so the total numbers after the dash will import differently based on the date. I've tried everything I can think of but am having no luck. Is there any way in a query to separate off the _###### and leave me with Name#13755 etc.

    Thanks,
    Leesha

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Separating Info (2002)

    Say that the field containing Name#12345_67890 is called MyField (I'm feeling particularly imaginative today). A text box with Control Source
    <code>
    =Left([MyField], InStr([MyField], "_")-1)
    </code>
    will display the part before the underscore _. Take care to give this text box a name different from MyField, otherwise Access will become confused.

  3. #3
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Separating Info (2002)

    Giggling over your "imagination" today. It worked like a charm! But then again I'm not surprised!

    Thanks,
    Leesha

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •