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 Shaun E 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.

peljo

Technical User
Mar 3, 2006
91
BG
I have the following query which i like to convert into a delete query and use the command
Dim StrDelete As String
DoCmd.RunSQL StrDelete
Can you help me ?

My query is the following :

SELECT [order details].OrderID, products.grade, [order details].ProductID, [order details].cartons, [order details].Quantity, [order details].liters, products.size, products.branch0, products.items0, orders.customerid,
Customers.Customerid FROM (([order details] INNER JOIN products ON [order details].ProductID = products.Productid) INNER JOIN orders ON [order details].OrderID = orders.orderid) INNER JOIN Customers ON orders.customerid = Customers.Customerid
WHERE ((([order details].OrderID)=(SELECT Max([orderid]) FROM orders)))ORDER BY products.grade;


 
Something like this ?
DELETE FROM [order details]
WHERE [order details]=DMax("orderid","orders")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top