update query

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.
 
Joined
Jun 12, 2007
Messages
3
Reaction score
0
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.
 
R

Rob Parker

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top