Delete Query

G

Guest

I have a list of itmes and sales quantities. Each item will appear multiple
times becuase the quantity will be different. I want to be able to delete
the max quantity associated with each item, how do I do that?

If I run a query and select Max quantity, it does not allow me to delete the
max qty.

Thanks,
Sean
 
G

Guest

First back up your data, then try using DMax in the query

In SQL:

DELETE TableName.*
FROM TableName
WHERE TableName.[quantities] =DMax("[quantities]","[TableName]","Item=" &
[Item])

As Criteria for quantity:
DMax("[quantities]","TableName","Item=" & [Item])


If the Item field is text then use
DMax("[quantities]","TableName","Item='" & [Item] & "'")


Make sure that the table name and fields name are correct
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top