Update query syntax help

J

Jack Sheet

Hi all
Access 97

I have two tables, "T_Clients" and "T_Tasks".
They share a field "Client_Ref" with a 1 (Clients) to many (Tasks)
relationship.
Clients also contains a Yes/No field called "SA_Return", and Tasks contains
a text field "Task_Type" that may contain various text strings from a list,
one of which is "SA100".

I want to create an Update query that converts to "Yes" the value in
"SA_Return" in each record of table "T_Clients" for which the criteria is
that there is at least one record of the same Client_Ref in table T_Tasks
with the value "SA100" in the field "Task_Type".

Hope that is clear. Currently struggling, and any help gratefully received.
 
B

Brendan Reynolds

UPDATE T_Clients SET T_Clients.SA_Return = True
WHERE (((T_Clients.Client_Ref) IN (SELECT Client_Ref FROM T_Tasks WHERE
Task_Type = 'SA100')));
 
J

Jack Sheet

Thanks that worked fine

Brendan Reynolds said:
UPDATE T_Clients SET T_Clients.SA_Return = True
WHERE (((T_Clients.Client_Ref) IN (SELECT Client_Ref FROM T_Tasks WHERE
Task_Type = 'SA100')));
 

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

Similar Threads

Update query syntax 2
Action query - help please 10
Which field to include? 8
Append Crosstab Query to Existing Table 0
Query produces unpredicted result 1
Relationships problems 4
Think I messed up 5
Subform problem 8

Top