S
shruti
Why am i getting an error "Operation must be an updateable query" in update
query?
query?
UPDATE 4_special_fees_recycling, Exception_List SET
4_special_fees_recycling.[Recycling Fee] = Exception_List.Fee
WHERE ((([4_special_fees_recycling].[Recycling Fee])<>Exception_List.Fee)
And (([4_special_fees_recycling].[P/N])=Exception_List.sku) And
(([4_special_fees_recycling].[Country Code])="81"));
John Spencer (MVP) said:Please copy and post the SQL of your query.
(Possibly unneeded instructions follow)
Open the query
Select View:Sql from the Menu
Select all the text
Copy it
Paste it into the message
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
shruti said:UPDATE 4_special_fees_recycling, Exception_List SET
4_special_fees_recycling.[Recycling Fee] = Exception_List.Fee
WHERE ((([4_special_fees_recycling].[Recycling Fee])<>Exception_List.Fee)
And (([4_special_fees_recycling].[P/N])=Exception_List.sku) And
(([4_special_fees_recycling].[Country Code])="81"));
Douglas J. Steele said:What's the SQL of your query?
From what you posted, I am not sure why you are getting the not updatable
message. I suspect the cartesian join might be the culprit, but that is a
guess. Also, if either of the two tables is a query then that could bethe
problem.
If 4_special_fees_recycling is a query and is not updateable, then using it in
this query would generate the message.
If Exception_List is a query and it uses aggregate functions (sum etc) itmay
be the cause of the problem, since you cannot use aggregate functions in an
update query.
I would try the following. Note that I set up an inner join and also
attempted to handle null values in the where clause.
UPDATE 4_special_fees_recycling INNER JOIN Exception_List
ON [4_special_fees_recycling].[P/N]=Exception_List.sku
SET 4_special_fees_recycling.[Recycling Fee] = [Exception_List].[Fee]
WHERE (
[4_special_fees_recycling].[Recycling Fee]<>Exception_List.Fee
OR ([4_special_fees_recycling].[Recycling Fee] is Null
AND Exception_List.Fee is Not Null)
OR ([4_special_fees_recycling].[Recycling Fee] is Not Null
AND Exception_List.Fee is Null)
)
And [4_special_fees_recycling].[Country Code]="81"
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
UPDATE 4_special_fees_recycling, Exception_List SET
4_special_fees_recycling.[Recycling Fee] = Exception_List.Fee
WHERE ((([4_special_fees_recycling].[Recycling Fee])<>Exception_List.Fee)
And (([4_special_fees_recycling].[P/N])=Exception_List.sku) And
(([4_special_fees_recycling].[Country Code])="81"));"John Spencer (MVP)" wrote:
- Show quoted text -
John Spencer (MVP) said:From what you posted, I am not sure why you are getting the not updatable
message. I suspect the cartesian join might be the culprit, but that is a
guess. Also, if either of the two tables is a query then that could be the
problem.
If 4_special_fees_recycling is a query and is not updateable, then using it in
this query would generate the message.
If Exception_List is a query and it uses aggregate functions (sum etc) it may
be the cause of the problem, since you cannot use aggregate functions in an
update query.
I would try the following. Note that I set up an inner join and also
attempted to handle null values in the where clause.
UPDATE 4_special_fees_recycling INNER JOIN Exception_List
ON [4_special_fees_recycling].[P/N]=Exception_List.sku
SET 4_special_fees_recycling.[Recycling Fee] = [Exception_List].[Fee]
WHERE (
[4_special_fees_recycling].[Recycling Fee]<>Exception_List.Fee
OR ([4_special_fees_recycling].[Recycling Fee] is Null
AND Exception_List.Fee is Not Null)
OR ([4_special_fees_recycling].[Recycling Fee] is Not Null
AND Exception_List.Fee is Null)
)
And [4_special_fees_recycling].[Country Code]="81"
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
UPDATE 4_special_fees_recycling, Exception_List SET
4_special_fees_recycling.[Recycling Fee] = Exception_List.Fee
WHERE ((([4_special_fees_recycling].[Recycling Fee])<>Exception_List.Fee)
And (([4_special_fees_recycling].[P/N])=Exception_List.sku) And
(([4_special_fees_recycling].[Country Code])="81"));
John Spencer (MVP) said:Please copy and post the SQL of your query.
(Possibly unneeded instructions follow)
Open the query
Select View:Sql from the Menu
Select all the text
Copy it
Paste it into the message
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Douglas J. Steele wrote:
What's the SQL of your query?
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.