Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Jul 2002
    Location
    Alaska, USA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Character stripping in a query (2000 SR1)

    I'm trying to find a query function that would allow me to strip the last four digits in a number field. The left() function doesn't work because the total number of digits varies from 8 to 15 digits.

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Character stripping in a query (2000 SR1)

    You said the LAST 4 digits, right? As in - 123456789 would give you 6789... Try this...

    =Right([fieldname],4)

    Hope this helps

  3. #3
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Character stripping in a query (2000 SR1)

    Or do you want it the other way around? IE, 12345678 will = 1234 or 1234567890ABCDE will = 1234567890A. In that case you would use this expression in query:

    Left([Field1],Len([Field1])-4)

    where Field1 is name of field.

    HTH

  4. #4
    New Lounger
    Join Date
    Jul 2002
    Location
    Alaska, USA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Character stripping in a query (2000 SR1)

    Yes....I wanted it the other way around....Your suggestion worked perfectly. The solution was a lot simpler than I thought it would be. Thanks for the help! --Larry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •