Results 1 to 10 of 10
  1. #1
    Hegnor is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2014
    Posts
    5

    Finding data based on the last digit of a field.

    Hello.

    I work with a database that will help me and keep track of when my vehicle shall at eu-control .. What I want the database to do.

    I enter the registration number license plate ex. BP62071

    In Norway the last digit of the license plate tells me how months car should in to eu-control.
    Then I want it to automatically add that this car should on eu-control in January. in a feld caled eu-control

    if the last number is 2 it should have been at eu-control in February

    can anyone help me with how I do this?



    tell you if there is anything you do not understand.

    thanks for the help

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Extract the last digit with:

    Right([fieldname],1)

    In query:

    SELECT *, Right([fieldname],1) AS EU_Control FROM tablename;
    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.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No eu-control in Oct-Dec? If there will be a 2-digit code at the end (ie 11), you'll need to come up with another method.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    Hegnor is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2014
    Posts
    5
    It's like this
    Janurary 1
    February 2
    March 3
    April 4
    May 5
    June 6
    July is no eu-control
    August 8
    September 9
    October 0
    December is no eu-control

    I can use it june7 suggest

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    November also no eu-control?
    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.

  6. #6
    Hegnor is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2014
    Posts
    5
    No november is 7

  7. #7
    Hegnor is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2014
    Posts
    5
    I'm pretty new so is there any chance that you or someone can help me and put this up so that work?

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    So what will work? What do you want to do?

    I suggested a query. Apply filter criteria to find records for any particular month.
    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.

  9. #9
    Hegnor is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2014
    Posts
    5
    Mente du: Jeg skal forklare hvordan jeg har tenkt at dette skal fungere.. Jeg vil kunne registrere kjøretøy via et skjema. Skjema_kjøretøy: Lisens plate Navnt på kjøretøy Eu-kontroll (denne ønsker jeg at komme automatisk ut fra det siste tallet fra licenc plate) En knapp som resetter eu-control 2 år fram i tid. skjønner du hva jeg mener?
    I'll explain how I intend that this should work ..

    I want to register vehicle via a form.

    form_vehicle :

    License plate
    name on vehicles
    Eu-control (this I want to come automatically from the last number of licenc plate)

    A button that resets the eu-control two years ahead.

    you know what I mean?

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Two years ahead of what?

    Today is November 4, 2014. If the eu_control is for February, do you want to save February 1, 2016?

    This gets a little complicated because the eu_control does not correspond directly to a month number for all months.

    Me!datefieldname = IIf(Right([licensefieldname],1)=0,10, Choose(Right([licensefieldname],1), 1, 2, 3, 4, 5, 6, 11, 8, 9)) & "/1/" & Year(Date()) + 2
    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. Importing 4 digit field as date
    By tagteam in forum Access
    Replies: 9
    Last Post: 06-13-2013, 02:34 PM
  2. Replies: 4
    Last Post: 10-11-2012, 07:40 AM
  3. Sort numbers based on second digit
    By Dale S in forum Queries
    Replies: 1
    Last Post: 05-16-2012, 07:06 AM
  4. Update the data to be in certain digit form
    By Nouri31 in forum Access
    Replies: 1
    Last Post: 01-17-2012, 01:34 PM
  5. Entering 16 digit numbers into number field
    By chrismid259 in forum Access
    Replies: 7
    Last Post: 12-14-2010, 10:40 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