copy from one field to another Query

Mar 30, 2009 5 Replies

SQL Statement to enter. I would like to copy the content of the sub description 1 field to the Reorder No Field. Currently the sub description 1 field has the reorder no info. Thank you for any hlep on this Query


The reorder information is actually held in a seperate table called SupplierList.

This should do the job.

INSERT INTO SupplierList (Item.ItemID, Item.SupplierID, Item.ReorderNumber) SELECT Item.ID as ItemID, Item.SupplierID, Item.SubDescription1 as ReorderNumber FROM Item WHERE (((Item.SupplierID) Is Not Null And Item.SubDescription1 '';

Once your happy that the above worked the way you wanted it too, run the following query to clean up the SubDescription1 field.

UPDATE Item SET Item.SubDescription1 = '' WHERE Item.SubDescription1 ''

Thank you Michael for your help. I am not sure how to fix it but I ran the query and this is what I get in the query window. An error occurred while executing query:

Incorrect syntax near ';'.

"Michael" wrote:

Try changing the single set of quotes to a double set:

WHERE (((Item.SupplierID) Is Not Null And Item.SubDescription1 "'';

Marc

Sorry try this one, I forgot the supplierlist already had a record (This is why you always test first)

This will only update the primary supplier from the SubDescription 1 field

Note: In the last line WHERE Item.SubDescription1 '' Thanks I tried another query that would copy and not insert. With insert

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required