Results 1 to 4 of 4
  1. #1
    saascuba is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2010
    Location
    Kernersville, NC
    Posts
    4

    Access Update with Join Problem

    Can anyone tell me what's wrong with the following query:



    UPDATE Equip_Info
    INNER JOIN Clean_Data
    ON Equip_Info.Equip_No = Clean_Data.Equip_No
    SET Equip_Info.Next_Clean_Date = (SELECT MAX(Date_Time) FROM Clean_Data WHERE Equip_No='10001')
    where Equip_Info.Equip_No = '1001'

    when running it in the MS Query tool it returns

    "Operation must use updateable query"

    The subquery works and only gives one value so I am not sure how to proceed.

    Thanks for your help

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    more than likely it is because you have an aggregate function in the query. that is one stopper for updating recordsets. you can't do it.

    you cannot update a set when there is an aggregate function present.

  3. #3
    NoellaG's Avatar
    NoellaG is offline VIP
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,044
    Hi saascuba,

    try changing (SELECT MAX(Date_Time) FROM Clean_Data WHERE Equip_No='10001') in:

    Dmax("Date_Time","Clean_Data","Equip_No = '10001'")

    gr
    NG

  4. #4
    saascuba is offline Novice
    Windows Vista Access 2007
    Join Date
    Nov 2010
    Location
    Kernersville, NC
    Posts
    4
    Thanks NoellaG, the dmax.... etc. worked.


Please reply to this thread with any new information or opinions.

Similar Threads

  1. Update statement with linked table join
    By Guigui in forum Queries
    Replies: 6
    Last Post: 09-17-2010, 04:47 AM
  2. Problem with Join
    By sujitshukla in forum Queries
    Replies: 1
    Last Post: 08-26-2010, 07:25 AM
  3. Many to many self-join problem
    By dbdbdo in forum Database Design
    Replies: 1
    Last Post: 07-18-2010, 09:31 AM
  4. Problem with Left Join & VB6
    By msrdjan1 in forum Queries
    Replies: 0
    Last Post: 03-30-2010, 01:48 AM
  5. Update with LEFT JOIN
    By mcarthey in forum Access
    Replies: 1
    Last Post: 08-27-2008, 10:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums