copy from one field to another Query

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

Reply to
normbest
Loading thread data ...

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 ''

Reply to
Michael

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:

Reply to
normbest

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

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

Marc

Reply to
Marc

Reply to
normbest

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

Reply to
Michael

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.