Results 1 to 5 of 5
  1. #1
    cjlieber is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2012
    Posts
    2

    Question how to decode a string of numbers

    I'm fairly new to this, so bear with me please!!


    I'm trying to decode a VIN and post the results in a table. I only need a couple of digits in the string for information. How do I select specific digits and then relate then to a table?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Look into the Mid() function.

  3. #3
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    In a query in a new field, create an expression and use the Find and/or Mid function

    http://www.techonthenet.com/access/f...ndex_alpha.php

    If you are more specific in your request, we can be more specific in the answer.

  4. #4
    cjlieber is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2012
    Posts
    2

    more specifically

    Quote Originally Posted by RuralGuy View Post
    Look into the Mid() function.
    I'm looking to decode A 17 digit number where the first three characters represent the make of the vehicle and the eighth digit represents the model year. what im trying to do is by entering the vin in a box on a form, write some code to fill in the make and year field on that form. I would use values in an excel spreadsheet. IE "1GC" would translate to chevrolet. I have those translations in excel already.

  5. #5
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Here's your query:

    SELECT Table1.ID, Table1.VIN, Left([VIN],3) AS Make, Mid([VIN],8,1) AS CarYear
    FROM Table1;

    Change the field and table names to match your database.

    Alan

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

Similar Threads

  1. Rounding numbers
    By jlgray0127 in forum Forms
    Replies: 5
    Last Post: 03-02-2012, 12:55 PM
  2. Replies: 1
    Last Post: 11-29-2011, 08:43 AM
  3. numbers
    By Balen in forum Access
    Replies: 1
    Last Post: 08-17-2010, 05:16 PM
  4. Removing all letters or all numbers from string
    By Hayley_sql in forum Programming
    Replies: 2
    Last Post: 09-16-2009, 02:01 AM
  5. Extract numbers from text string strored in a field.
    By khabdullah in forum Programming
    Replies: 2
    Last Post: 12-23-2007, 06:55 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