Results 1 to 3 of 3
  1. #1
    weilerda is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Posts
    2

    Trying to find a value right of specific string with in text

    I'm new to access but am familiar with sql. I've imported a csv file into access and I have a column I need to pull specific information out. Here is an example of the text in the column.



    (113:000034.310,SHPG100:000032.040,SBRD100:000034. 160,AGC100:000034.310)
    (113:000031.950,SHPG100:000031.950,SBRD100:000031. 950,AGC100:000031.950)
    (994010:000024.630,090003:000026.180,090001:000026 .180)

    I need to find the value to the right of specific string.
    For Example I want to find only the values for SHPG100
    SHPG100 000032.040
    SHPG100 000031.950

    Any help would be greatly appreciated. Thanks in advance for your help.

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Are you doing this in a query?

    Let's assume your TABLE is named Table1
    Let's assume your FIELD is named Field1

    Code:
    SELECT Table1.field1, InStr([field1],"SHPG100") AS StartPos, InStr([startpos]+1,[field1],",") AS EndPos, Replace(Mid([field1],[startpos],[endpos]-[startpos]),":"," ") AS FinalString, Replace(Mid([field1],(InStr([field1],"SHPG100")),(InStr((InStr([field1],"SHPG100"))+1,[field1],","))-(InStr([field1],"SHPG100"))),":"," ") AS FinalStringSingleStatement
    FROM Table1
    WHERE (((Table1.field1) Like "*SHPG100*"));
    I left some fields in there to show you how I built it bit by bit.

  3. #3
    weilerda is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Posts
    2
    Thanks! That Worked.

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

Similar Threads

  1. find all text string in Criteria at once
    By Jerseynjphillypa in forum Queries
    Replies: 3
    Last Post: 05-15-2012, 12:12 PM
  2. Find first Capital letter in string
    By Dutch1956 in forum Programming
    Replies: 5
    Last Post: 09-07-2011, 03:14 PM
  3. Find specific value in any field
    By bkvisler in forum Queries
    Replies: 8
    Last Post: 12-08-2010, 04:23 PM
  4. Split string when specific word is found
    By DB4284 in forum Programming
    Replies: 1
    Last Post: 11-18-2010, 03:30 PM
  5. get a specific data in a string
    By dada in forum Programming
    Replies: 2
    Last Post: 09-21-2010, 01:20 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