Results 1 to 4 of 4
  1. #1
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2003
    Join Date
    Sep 2013
    Posts
    287

    Numbers to a letter

    Hey guys,



    We have employee codes in our system, i.e. 07173 is mine. Our new system requires the first character of a employee code to be a letter. The powers at be have decided to convert the first 2 numbers to a letter. 00=A, 01=B, ... , 25=Z. My code, 07173 would be H173. I am aware that this solution will fail eventually, but in the 12 years of business, we haven't gone thru 10000 employees yet, so we should be good for a while. Is there an easier way to do this besides a big Select Case formula that goes thru the alphabet?

    I know I would have to make that formula go thru the first, say, 15 letters to be safe for a while. But I am more curious for my own knowledge.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    What is the purpose? Is it to convert all the existing codes to alphanumeric and then, moving forward, fill in all of the (left over) possible AXXX before moving to B?

    Or is the purpose to use the old way of assigning employee codes and simply display them using this Alpha key?

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Build a table. A query can have calculated field that extracts the first 2 digits from the old code and another calculated field to extract the other 3 digits. Join this query to the table. Concatenate the alpha prefix with the 3 digit field. Run UPDATE query to edit existing field or populate new field in Employees table.

    Is the employee code a PK/FK?
    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.

  4. #4
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2003
    Join Date
    Sep 2013
    Posts
    287
    Got it, June7. Thanks!

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

Similar Threads

  1. Replies: 8
    Last Post: 03-10-2014, 11:47 AM
  2. Replies: 4
    Last Post: 09-18-2012, 05:07 AM
  3. Replies: 1
    Last Post: 11-29-2011, 08:43 AM
  4. filter name by letter
    By kbremner in forum Programming
    Replies: 3
    Last Post: 10-30-2010, 07:48 PM
  5. From letter from a report
    By LANCE in forum Reports
    Replies: 4
    Last Post: 07-04-2009, 09:32 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