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 Question (WIN XP/Access 97)

    TableA
    fldOne - text field w/ 10 or 11 characters
    fldTwo - Will always be the Right 7 characters of fldOne
    fldThree - Left 3 or 4 characters of fldOne (depending on how many characters in fldOne)

    I need to write an update query that says:
    If fidOne has 10 characters update fldThree with Left 3 characters from fldOne
    If fldOne has 11 characters update fldThree with Left 4 characters from fldOne

    Thanks as always for your help.

    Michael

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

    Re: Update Query Question (WIN XP/Access 97)

    The usual question first: why do you want to store fldTwo and fldThree in the table? They are derived values, so you can easily calculate them in a query. This has the advantage of avoiding duplicate storage and of always being up-to-date.

    Anyway, the expression you need for fldThree, whether in a select query or in an update query, is

    <code>Left([fldOne], Len([fldOne]) - 7)</code>

  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 Question (WIN XP/Access 97)

    I don't know if you get to read the follow up thank you posts Hans, but if you do,
    THANK YOU !!!!

    Michael

Posting Permissions

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