Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Amerigo is offline Novice
    Windows 98/ME Access 97
    Join Date
    Mar 2011
    Posts
    24

    Breaking the string into Text / Number

    So for the example below - everyrhing starting with 1 to go to go to the separate column


    Is there an easy way ?




    Weighted Average Duration 1.07 4.99Weighted Average Maturity 1.20 12.57Weighted Average Yield to Worst* 1.96 3.30

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    hmm...this post is not comprehendable.

    what do you want to do?

  3. #3
    Amerigo is offline Novice
    Windows 98/ME Access 97
    Join Date
    Mar 2011
    Posts
    24
    Quote Originally Posted by ajetrumpet View Post
    hmm...this post is not comprehendable.

    what do you want to do?
    hey -
    so I have 1 column containing text followed by numbers (exam below)
    I'd like to separate text/number

    Weighted Average Duration 1.07 4.99
    Weighted Average Maturity 1.20 12.57
    Weighted Average Yield to Worst* 1.96 3.30

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Hi
    Yes it is possible but to give you help on how to do it I need a little more information on exactly what you want to do. For example:

    1 Where and how are you displaying the column? (Table, Query DataSheet Form)

    2 You want to seperate the numbers and then do what? (Show them in a second column? )

    3 Do yoy want to save the seperation in your tables?

  5. #5
    Amerigo is offline Novice
    Windows 98/ME Access 97
    Join Date
    Mar 2011
    Posts
    24
    hey Bob - thanks for replying
    yes data is in one column currently, I would like to show the numbers in the second column (in a query)

    sorry, don't understand the 3rd column

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Hi
    Can you post the SQL of this query?

  7. #7
    Amerigo is offline Novice
    Windows 98/ME Access 97
    Join Date
    Mar 2011
    Posts
    24
    Quote Originally Posted by Bob Fitz View Post
    Hi
    Can you post the SQL of this query?
    There's no query at the present - I am planning t ohave a query based on that table that has 1 column

    eewettr5678
    tfhujftrjytfc6778
    tjyjyjg7878%
    ehhtibkmbmfmtlklkrd2132

  8. #8
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    OK. Can you tell us the name of the table and the name of the one field?

  9. #9
    Amerigo is offline Novice
    Windows 98/ME Access 97
    Join Date
    Mar 2011
    Posts
    24
    Quote Originally Posted by Bob Fitz View Post
    OK. Can you tell us the name of the table and the name of the one field?
    Tbl1 , Field1 is fine )
    I'll update once i'll what it was in the office

  10. #10
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Hi
    This should give you the results that you require:

    SELECT Trim(Left([Field1],Len([Field1])-10)) AS TxtFld, Trim(Right([Field1],10)) AS NumFld
    FROM Table1;

  11. #11
    Amerigo is offline Novice
    Windows 98/ME Access 97
    Join Date
    Mar 2011
    Posts
    24
    Quote Originally Posted by Bob Fitz View Post
    Hi
    This should give you the results that you require:

    SELECT Trim(Left([Field1],Len([Field1])-10)) AS TxtFld, Trim(Right([Field1],10)) AS NumFld
    FROM Table1;
    wow, almost there
    except it's bringing first number
    Field1TxtFldNumFldNO VALUE 0.01% 0.00%NO VALUE 0.01% 0.00%Swap 0.00% 0.00%Swap 0.00% 0.00%EMD 0.04% 1.38%EMD 0.04% 1.38%Agency 0.00% 0.00%Agency 0.00% 0.00%Basic Industry 0.00% 0.05%Basic Industry 0.00% 0.05%Capital Goods 0.00% 0.03%Capital Goods 0.00% 0.03%Communications 0.02% 0.05%Communications 0.02% 0.05%

  12. #12
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Sorry, but I don't understand your reply.
    I tested the proposed solution with the data you posted in your second post:
    Weighted Average Duration 1.07 4.99
    Weighted Average Maturity 1.20 12.57

    Weighted Average Yield to Worst* 1.96 3.30

    This is the result:

    Query1TxtFldNumFldWeighted Average Duration1.07 4.99Weighted Average Maturity1.20 12.57Weighted Average Yield to Worst*1.96 3.30

    Where does:
    Field1TxtFldNumFldNO VALUE 0.01% 0.00%NO VALUE 0.01% 0.00%Swap 0.00% 0.00%Swap 0.00% 0.00%EMD 0.04% 1.38%EMD 0.04% 1.38%Agency 0.00% 0.00%Agency 0.00% 0.00%Basic Industry 0.00% 0.05%Basic Industry 0.00% 0.05%Capital Goods 0.00% 0.03%Capital Goods 0.00% 0.03%Communications 0.02% 0.05%Communications 0.02% 0.05%
    Come from?

  13. #13
    Amerigo is offline Novice
    Windows 98/ME Access 97
    Join Date
    Mar 2011
    Posts
    24
    silly me, i just had to change it to 11

  14. #14
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    We all make simple mistakes, but does it solve your problem?

  15. #15
    Amerigo is offline Novice
    Windows 98/ME Access 97
    Join Date
    Mar 2011
    Posts
    24

    Thumbs up

    Quote Originally Posted by Bob Fitz View Post
    Sorry, but I don't understand your reply.
    I tested the proposed solution with the data you posted in your second post:
    Weighted Average Duration 1.07 4.99
    Weighted Average Maturity 1.20 12.57
    Weighted Average Yield to Worst* 1.96 3.30

    This is the result:

    Query1TxtFldNumFldWeighted Average Duration1.07 4.99Weighted Average Maturity1.20 12.57Weighted Average Yield to Worst*1.96 3.30

    Where does:
    Field1TxtFldNumFldNO VALUE 0.01% 0.00%NO VALUE 0.01% 0.00%Swap 0.00% 0.00%Swap 0.00% 0.00%EMD 0.04% 1.38%EMD 0.04% 1.38%Agency 0.00% 0.00%Agency 0.00% 0.00%Basic Industry 0.00% 0.05%Basic Industry 0.00% 0.05%Capital Goods 0.00% 0.03%Capital Goods 0.00% 0.03%Communications 0.02% 0.05%Communications 0.02% 0.05%
    Come from?
    I guess at some points the number at the end becomes longer; i'll look through on monday, but i can figure an IIF statement for that

    thnaks a lot !!!!!!!!

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 04-19-2011, 06:41 PM
  2. Switching from string to a number using Dmax
    By dsheets05 in forum Access
    Replies: 3
    Last Post: 12-15-2010, 03:07 PM
  3. Remove zeros within a number string
    By catguy in forum Queries
    Replies: 3
    Last Post: 02-25-2010, 07:47 AM
  4. I need to remove a dash from a number string.
    By catguy in forum Programming
    Replies: 3
    Last Post: 02-18-2010, 02:56 PM
  5. Auto Sequence String Serial Number
    By eddyc99 in forum Programming
    Replies: 2
    Last Post: 10-02-2009, 08:11 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