Results 1 to 7 of 7
  1. #1
    Werner is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Mar 2016
    Location
    Canada
    Posts
    3

    Convert a complete string into a number

    Hi Forum,


    I need a code number (any number) to identify or group different entity types from the same column
    The Val([Entity]) function doesn't work in this case. Is there any function to convert a complete string into a number?

    See example below:


    Entity Code
    A-0-1 1
    0-1-1 2
    A-0-1 1
    A-0-1 1
    P-32-24 3
    A84-R-W5 4
    A84-R-W5 4
    0-1-1 2
    A84-R-W6 5


    Any help will be much appreciated

  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,652
    Could be, but I don't see any pattern as to why a given entity gets a certain code. What rules are you applying?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Werner is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Mar 2016
    Location
    Canada
    Posts
    3
    Thanks for reply,
    There's no rules. I just want to assign a number (any number), the same number to the same entity in column entity
    Suppose we have a column with repeated names, then the code column should have 1 for all John, 2 for all Mikes and so on. Could be any number but the same number for each entity named the same.
    Your comments or questions are welcome
    Thank you

  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,652
    I'd have a table of entities, one record for each. You can use an autonumber field to get a unique code for each, or input your own value. Then in a query join the 2 tables together.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Werner is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Mar 2016
    Location
    Canada
    Posts
    3
    Sound excellent. I will give it a try
    Thanks a lot for your idea

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    No problem, post back if you get stuck. Welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    androo235 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2016
    Posts
    2
    Surely this one is solved - that is the answer isn't it?

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

Similar Threads

  1. Qurey Number of days to complete operation.
    By Barryg in forum Queries
    Replies: 14
    Last Post: 03-27-2014, 01:33 PM
  2. Replies: 0
    Last Post: 10-22-2012, 02:45 PM
  3. How to Convert string to Number?
    By taimysho0 in forum Programming
    Replies: 1
    Last Post: 02-24-2012, 01:57 PM
  4. Replies: 2
    Last Post: 11-22-2011, 11:45 AM
  5. Convert Number to String in .csv extract
    By CindyR19 in forum Import/Export Data
    Replies: 3
    Last Post: 08-17-2011, 02:58 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