Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Update problem.

Status
Not open for further replies.

glavster

Technical User
Mar 30, 2007
48
IE
Hello I'm trying to do an update query by compairing certain fields. Here is the query so far,

UPDATE [Enhanced-GB] INNER JOIN va_categories ON ([Enhanced-GB].SubCategory = va_categories.parent_category_id) AND ([Enhanced-GB].Sub_SubCategory = va_categories.category_name) AND ([Enhanced-GB].Category = va_categories.category_path) SET [Enhanced-GB].Sub_SubCategory = [va_categories].[category_id];

the problem is with this line "AND ([Enhanced-GB].Category = va_categories.category_path)" The [Enhanced-GB].Category is not equal to va_categories.category_path but only to a part of it. It in this format "0,1,2, and [Enhanced-GB].Category is only equal to the 1.

Can anyone tell me how to fix that.

Thanks again,
Paul
 
In short, look at the data and the design of the table and see what is not allowed.

Key violations means that you are doing something that a key (index) in the table does not allow. For example if the is a unique index on a field and there is already a record with a 5 in that field then you can not add another record with a 5 in that field. I rarely use them but I think you could also see this error message if the appending record would fail a validation rule.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top