I have a query that pulls back 50 rows (which is correct):
select * from [Review Results], [Specialist Name Table]
where [Authorizer Manager Name] = 5
and [Specialist Name Table].[Penson Analyst] = TRUE
and [Review Results].[Authorizer Name] = [Specialist Name Table].[ID]
I’m trying to make an update query out of the above but i cannot seem to get this correct. This is the query that I am using however it wants to update 461 rows opposed to 50:
update
[Review Results] e
INNER JOIN [Specialist Name Table] s ON e.[Authorizer Name] = s.[ID]
set e.[Authorizer Manager Name] = 5
where s.[Penson Analyst] = TRUE
Can anyone help out?
Note that your select query has a filter in the where clause:
This is restricting the returned set to those rows that have an “Authorizer Manager Name” of 5. In your update query, this filter is not there. Rather, your update query is saying “set the Authorizer Manager Name to 5 when the Pension Analyst field is TRUE”. So basically, your update query is addressing a superset of your select query.
In short, your select query is returning those rows where the Pension Analyst is TRUE AND where the Authorizer Manager Name is already 5, and your update is returning only where the Pension Analyst is TRUE.