J
John Reynolds
My orginal query was as follows:
I have a table with a field that needs to be updated.
I have the following update query:
UPDATE
SET Field1 = '5MH00'
WHERE Field1 = '5MH';
This works fine, but how do I get the update query to
update Field1 with various updates ie.
FROM TO
5MG 5MG00
5MT 5MT00
465 457
Do I have to create seperate update queries or can I merge
all these updates into one update query?
Michel was able to help to sort this out with the
following answer...
Yep. Make a table
Translate ' table name
Was ShouldBe ' fields name
5MG 5MG00
5MT 5MT00
465 467 ' data
Then, after having make a backup (or a copy) of the real
data:
UPDATE table1 INNER JOIN Translate ON
table1.field1=translate.was
SET table1.field1=translate.ShouldBe
Hoping it may help,
Vanderghast, Access MVP
My next question is...
Is it possible to update Field2 within the same update
query. Where Field2 needs the following types of updates:
1 to 01
2 to 02 etc...
..
I have a table with a field that needs to be updated.
I have the following update query:
UPDATE
WHERE Field1 = '5MH';
This works fine, but how do I get the update query to
update Field1 with various updates ie.
FROM TO
5MG 5MG00
5MT 5MT00
465 457
Do I have to create seperate update queries or can I merge
all these updates into one update query?
Michel was able to help to sort this out with the
following answer...
Yep. Make a table
Translate ' table name
Was ShouldBe ' fields name
5MG 5MG00
5MT 5MT00
465 467 ' data
Then, after having make a backup (or a copy) of the real
data:
UPDATE table1 INNER JOIN Translate ON
table1.field1=translate.was
SET table1.field1=translate.ShouldBe
Hoping it may help,
Vanderghast, Access MVP
My next question is...
Is it possible to update Field2 within the same update
query. Where Field2 needs the following types of updates:
1 to 01
2 to 02 etc...
..