Update table using data from another table - MS Access

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bo Long

    #1

    Update table using data from another table - MS Access


    I believe the following a valid SQL statement, but MS Access returns
    with an error "Operation must be an updateable query".

    Any suggestions would be greatly appreciated!

    UPDATE FERCPTILoad AS FL
    SET FL.[Load Dist Factor] = FL.[MW]/(
    select FA.[Load MW]
    from FERCPTIArea AS FA
    where FA.[Area Num] = FL.[Area Num of Bus]);



    *** Sent via Developersdex http://www.developersdex.com ***
  • pietlinden@hotmail.com

    #2
    Re: Update table using data from another table - MS Access


    Bo Long wrote:[color=blue]
    > I believe the following a valid SQL statement, but MS Access returns
    > with an error "Operation must be an updateable query".
    >
    > Any suggestions would be greatly appreciated!
    >
    > UPDATE FERCPTILoad AS FL
    > SET FL.[Load Dist Factor] = FL.[MW]/(
    > select FA.[Load MW]
    > from FERCPTIArea AS FA
    > where FA.[Area Num] = FL.[Area Num of Bus]);
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***[/color]

    Why not try using DLOOKUP instead of the subselect? My guess is that
    since the subquery could conceivably return more than one record, the
    update query won't work.

    Comment

    Working...