Update Several records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table of actual dollars spent with project numbers and categories.
Some of the categories are incorrect. For example... Project 1 has a
category of Growth and should be Non-Growth.
I have several projects (1530 to be exact) that I need to update the
category. I know how to update one at a time, but was hoping I could do it
more effectively. I have another table in the database with the listing of
the projects with the correct category.
Table names are 'Actuals' for the orginal data and the corrected table is
called 'tbl_Correct_Categories'.
Thanks.
 
GENERIC QUERY Follows

UPDATE Actuals INNER JOIN tbl_Correct_Categories as CC
INNER JOIN Actuals.[ProjectIDField] = CC.[ProjectIDField]
SET Actuals.[Category]=CC.[Category]

Back up your data FIRST. Then try the query and see if it works. If not reload
your data from the backup and try alternative(s).
 
I have a table of actual dollars spent with project numbers and categories.
Some of the categories are incorrect. For example... Project 1 has a
category of Growth and should be Non-Growth.
I have several projects (1530 to be exact) that I need to update the
category. I know how to update one at a time, but was hoping I could do it
more effectively. I have another table in the database with the listing of
the projects with the correct category.
Table names are 'Actuals' for the orginal data and the corrected table is
called 'tbl_Correct_Categories'.
Thanks.

Create a Query joining Actuals to tbl_Correct_Categories by the
project ID. For safety's sake, add a criterion of ="Growth" on the
category field to select only those records that DO need changing.
Change the query to an Update query; put the desired value on the
Update To line. Run the query.

John W. Vinson[MVP]
 
Back
Top