Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2013
    Location
    Milwaukee, WI, USA
    Posts
    5

    Splitting long string to multiple fixed-length strings? Possible w/query?

    So, I have a table where I want to break longer strings into three-character strings.



    So... for example the data item "Forest," I'd like to generate "FOR" "ORE" "RES" "EST" and write all four to another table, allowing for duplication. Alternately, we could make a list and just count the unique 3-character strings. The end goal here is to measure the frequency of 3-character strings across a set of data.

    Any thoughts on how to do this with an Access query?

    Thanks!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    If the data length never changed (always 6 characters), this could be done entirely within query. However, I expect the data length is variable and will therefore require a VBA procedure. The procedure would open a recordset, loop through records, extract the substrings, write records to another table.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 7
    Last Post: 08-26-2013, 06:05 AM
  2. Replies: 3
    Last Post: 07-26-2012, 03:09 PM
  3. Replies: 8
    Last Post: 02-22-2012, 11:58 AM
  4. Fixed character length of field
    By tylerg11 in forum Access
    Replies: 3
    Last Post: 09-29-2011, 11:58 AM
  5. Convert number to fixed length text field
    By tpcervelo in forum Queries
    Replies: 1
    Last Post: 08-02-2010, 07:26 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