Delete Query

S

Sean

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
 
O

Ofer Cohen

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
 
Top