deleting items via supplier ID

what quary would I need to delete all items attached to a specific supplier. ie delete all items suppied by the xyz company

Thanks, Ron

Reply to
shoeman240
Loading thread data ...

Do you want to actually delete the items or do you want to just delete the association to that Supplier?

To get X do this first: SELECT ID FROM Supplier WHERE SupplierName = 'XYZ Company' This will delete the Items from your database: DELETE FROM Item WHERE Supplier.ID = 'X'

If you want to keep the items in the database but want to delete any associations between items and a specific supplier do this: DELETE FROM SupplierList WHERE Supplier.ID = 'X'

Rob

Reply to
Rob

Tried to run the Query and recieved this error message.. DELETE FROM Item WHERE Supplier.ID = 'X'

The column prefix 'Supplier' does not match with a table name or alias name used in the query.

Any advise.

"Rob" wrote:

Reply to
shoeman240

Sorry, that should have read: DELETE FROM Item WHERE Item.SupplierID = 'X'

That is why it is so very important to do a backup of your database before running any query. Ya never know.

Rob

Reply to
Rob

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.