Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete query

Status
Not open for further replies.

samotek

Technical User
May 9, 2005
197
BG
I need to update the table products from the products in the table [order details] and also delete all the products in the table products that are not contained in the table [order details]. My update query is sucessful as follows
UPDATE products1 INNER JOIN [Order Details1] ON products1.Productid = [Order Details1].productid SET products1.branch9 = [order details1].[cartons];
But how can i delete the products that are not contained in the table order details?
 
Something like:
Code:
DELETE products1.*
FROM products1
WHERE (((products1.ProductID) Not In (SELECT [Order Details1].ProductID FROM [Order Details1])));
Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top