Updating Table from a Query

pachederm

Registered User.
Local time
Today, 11:47
Joined
Sep 14, 2011
Messages
13
0 down vote favorite
Hi, was wondering if anyone can help me out with this.



I have a table and a query both of which have the same [Resource ID], [Resource Name] fields.



I am trying to update the [CBL_1_Date], and the [CBL_1_kW] fields in the table with the [CBL_x_Date] and [CBL_x_kW] fields of the query. The problem is that when I try to run the query I keep getting "Operation Must Use and Updateable Query" error.


here is the SQL Code

UPDATE tCBLAggregation
INNER JOIN qBestof4CBLs_avg
ON (tCBLAggregation.[Event Date] = qBestof4CBLs_avg.[Event Start Date]) AND (tCBLAggregation.[Resource ID] = qBestof4CBLs_avg.[Resource ID])
SET tCBLAggregation.CBL_1_Date = [qBestof4CBLs_avg].[CBL_x_Date], tCBLAggregation.CBL_1_kW = [qBestof4CBLs_avg].[AvgOfCBL_x_kW];
 
pachederm,

Try:

Code:
UPDATE tCBLAggregation 
SET tCBLAggregation.CBL_1_Date = [qBestof4CBLs_avg].[CBL_x_Date], 
    tCBLAggregation.CBL_1_kW = [qBestof4CBLs_avg].[AvgOfCBL_x_kW]
From tCBLAggregation, [qBestof4CBLs_avg] 
Where tCBLAggregation.[Event Date] = qBestof4CBLs_avg.[Event Start Date] AND 
      tCBLAggregation.[Resource ID] = qBestof4CBLs_avg.[Resource ID]

Wayne
 

Users who are viewing this thread

Back
Top Bottom