• Update Query Question (WIN XP/Access 97)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Update Query Question (WIN XP/Access 97)

    Author
    Topic
    #428709

    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

    Viewing 0 reply threads
    Author
    Replies
    • #996563

      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

      Left([fldOne], Len([fldOne]) - 7)

      • #996598

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

        Michael

    Viewing 0 reply threads
    Reply To: Update Query Question (WIN XP/Access 97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: