Update query (1 Viewer)

adil_karampurwa

Registered User.
Local time
Yesterday, 16:41
Joined
Sep 18, 2006
Messages
23
I have two table Client_details and Release_details in a database,were client field is the primary keyin both the tabels.I want to update records of Airtel-India in Release_details,for that i have wrriten a query

UPDATE Client_detail, Release_detail SET Client_detail.Client = "Airtel-India", Release_detail.Client = "Airtel-India"
WHERE (((Client_detail.Client)="Bharati Chennai") AND ((Release_detail.Client)="Bharati Chennai"));

but after running an error message is shown like

Microsoft access didnt update 0 fileds due to a type conversion failure,16 records due to key violations,0 records due to validation rule violations
 

Krava

Registered User.
Local time
Today, 00:41
Joined
Jul 13, 2005
Messages
72
Hi Adil!

I think the main problem would be that you are going to update multiple records, field "client" to the same value. Fiel "client" is a Primary key so it must not be the same, as it has to be unique.

Krava
 

adil_karampurwa

Registered User.
Local time
Yesterday, 16:41
Joined
Sep 18, 2006
Messages
23
i want to change name of Bharti chennai to Airtel-India.......
so want to update all records into Airtel-India....how to proceed
 

Krava

Registered User.
Local time
Today, 00:41
Joined
Jul 13, 2005
Messages
72
Adil!

Actually I have realized that I am missing the join between those two tables. If you do not join them the query result affect all combinations of all records from both tables matching your criteria.
I suppose you should try to join the tables via the Primary key fields ("client").

Krava
 

Users who are viewing this thread

Top Bottom