Results 1 to 7 of 7
  1. #1
    anstasija is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    3

    Ignore last two digits in formula

    Hi Everyone,

    I am fighting for about an hour now to find out how to manage it that Access will only consider the 7th and 8th digit of the item number BB33-0KK and not duplicate the 5th and 6th digit of the remaining items.

    Here is the item list:



    Item number
    BB22-1
    BB22-5
    BB33-0KK
    CC00-2

    My query has the following formula:
    A7-8: Right(Left([price download].[item],8),2)
    But in the data sheet view in column A7-8 it is using the 5th and 6th digit for the remaining part numbers instead of ignoring those or using "0", please see below:
    A7-8
    -1
    -5
    KK
    -2
    Hope you can understand my description. I appreciate your help.
    Thank you.

  2. #2
    LillMcGill is offline Dagny fan
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Oct 2010
    Location
    Southern USA
    Posts
    70
    A7-8: IIf(Len([item])=8,Right([item],2),0)

  3. #3
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    If you only want the 7th and 8th dight: mid(([price download].[item],8,2)

  4. #4
    anstasija is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    3
    Quote Originally Posted by weekend00 View Post
    If you only want the 7th and 8th dight: mid(([price download].[item],8,2)

    Thank you for your advice. I have tried it and it returned suprisingly only the last digit (the last K) of the part number with the "KK" addition. I need both of them there.

    The remaining part numbers were blank, which is already a win.

  5. #5
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Actually not surprising. It's probably a typo on weekend's part; if you want the 7th and 8th you'd have to start at the 7th:

    mid(([price download].[item],7,2)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    anstasija is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    3
    Could think about it myself....
    Many thanks. It works very good now!

  7. #7
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help, and welcome to the site!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. rounding digits
    By giladweil in forum Access
    Replies: 1
    Last Post: 09-01-2010, 03:11 AM
  2. Replies: 2
    Last Post: 08-17-2010, 02:58 PM
  3. Report query by digits
    By The Phil in forum Reports
    Replies: 4
    Last Post: 04-23-2010, 11:52 AM
  4. On Click - Ignore Required Fields
    By amy in forum Forms
    Replies: 1
    Last Post: 08-18-2009, 07:42 AM
  5. Left function with various lenth of digits
    By mohsin74 in forum Queries
    Replies: 0
    Last Post: 07-10-2007, 02:00 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