Complex UPDATE Query

tension22

New member
Local time
Today, 14:47
Joined
May 22, 2010
Messages
3
Hi,

Basically I have around 200 UPDATES that need to run, so from collum 'products' I need to change:

PC to DELL PC
Ipod to Apple Ipod
x another 200 updates.

Obviously that will take ages to run each one on there own. So I have tried to make another table to hold the original value, and the updated value:

UPDATE TABLE, tblFindReplaceWords SET TABLE.Products = Replace(
.[Products],[tblFindReplaceWords].[FINDWORD],[tblFindReplaceWords].[REPLACEWORD]);

But that keeps maxing out on me, running out of memory.

Is there another way to do it? Just like if product is "PC" change to "DELL PC" but for all require updates on 1 query?

Thanks
 
Either way, you will have to type at least once that "PC" is now "Dell PC" no matter how complicated you make the task.

Can you make a form and run your update query on this you type in the search name and update name each time the query runs.

This way you type in PC and Then Dell PC just once and then onto the next update scenario.
 
This sql will ask for the old value and the new value and then do the update.

UPDATE TblComplexUpdate SET TblComplexUpdate.ProductsField = [Enter New Data]
WHERE (((TblComplexUpdate.ProductsField)=[Enter Old Data]));

if you ran it via a macro you could turn off the warnings and speed up the process - backup the table first.
 
By using IIf([field1]="PC","DEL PC",[field1]) type constructs in the update to row , instead of criteria, you can update more than 1 field in an Update query

Brian
 

Users who are viewing this thread

Back
Top Bottom