Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Sacramento, California, USA
    Posts
    491
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Update Query (WIN 2000 Acc 97)

    I've been going in circles with this and I am hoping someone can help.

    I have a field Group.
    Sample data:
    4445556667 1
    676768 1
    3234555555555 1
    Every record has a 1 at the end.
    Each record can have a different amount of numbers before the 1.

    I am trying to eliminate the 1 at the end. I've tried Mid, right etc and just can't
    seem to get the right combination to accomplish this.

    I tried an update query and even tried writing code in a form.
    Can't get it.

    Can you please help?

    Thanks!!
    Michael Abrams

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Update Query (WIN 2000 Acc 97)

    If EVERY value ends in " 1" (a space followed by the digit 1), you can use an update query; code is overkill in that case. Use this expression in the Update To line:

    Left([Group],Len([Group])-2)

    If the space before the 1 was only for illustration purposes, and not present in the real data, use

    Left([Group],Len([Group])-1)

    instead. The Len function returns the length of the string; by subtracting 2 (or 1), we get the length of the first part, without the 1. The Left function returns that first part.

  3. #3
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Sacramento, California, USA
    Posts
    491
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Update Query (WIN 2000 Acc 97)

    Thanks Hans. You did it again !!

    I really appreciate your help, ESPECIALLY on a Saturday !!

    Sincerely,
    Michael Abrams

Posting Permissions

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