update query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I am working with access 2003 and I would like to update one field in table
A. The value of this field I get from a select.
The query I would like to build is like this:
UPDATE Table_1 AS T1 SET T1.Field_1 = (select field_2 from Table_2 AS T2
where
T2.[currency] = T1.[Currency]
and
T2.[Date] = T1.[Date]
);

However, when I execute this query I get the following error: "Operation
must use an updateable query" .

Is there a way of doing it using "queries" in Access?

Thanks.
 
You are getting the error mesage because you are linking a table with a query. You have to use two tables instead.

=?Utf-8?B?ZG1vcmV0bw==?= said:
Hi,
I am working with access 2003 and I would like to update one field in table
A. The value of this field I get from a select.
The query I would like to build is like this:
UPDATE Table_1 AS T1 SET T1.Field_1 = (select field_2 from Table_2 AS T2
where
T2.[currency] = T1.[Currency]
and
T2.[Date] = T1.[Date]
);

However, when I execute this query I get the following error: "Operation
must use an updateable query" .

Is there a way of doing it using "queries" in Access?

Thanks.
 
Try this:

UPDATE Table_1 AS T1 INNER JOIN Table_2 AS T2 ON (T1.[currency] =
T2.[currency]) AND (T1.Date = T2.Date) SET T1.[Field_1] = T2.[Field_2];

Rob
 
Back
Top